Ticket #1864: sage-1864.patch

File sage-1864.patch, 1.2 KB (added by was, 11 years ago)
  • sage/server/notebook/worksheet.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1210485978 25200
    # Node ID 5886085a5d53cf2d385a2b7418b0490c9c35aaee
    # Parent  bf1d49c9c7de5bcb0f4908dd626020b4869d5553
    trac #1864 -- simple notebook bug -- typing ? in a comment yields introspection but shouldn't (easy to fix in worksheet.py, probably)
    
    diff -r bf1d49c9c7de -r 5886085a5d53 sage/server/notebook/worksheet.py
    a b class Worksheet: 
    13691369        absD = os.path.abspath(D)
    13701370        input = 'os.chdir("%s")\n'%absD
    13711371
    1372         # TODOss
    13731372        os.system('chmod -R a+rw "%s"'%absD)
    13741373
    13751374        # This is useful mainly for interact -- it allows
    class Worksheet: 
    13781377       
    13791378        if C.time():
    13801379            input += '__SAGE_t__=cputime()\n__SAGE_w__=walltime()\n'
    1381         if I.endswith('?'):
     1380
     1381        # If the input ends in a question mark and is *not* a comment line,
     1382        # then we introspect on it.
     1383        Istrip = I.strip()
     1384        if Istrip.endswith('?') and not Istrip.startswith('#'):
    13821385            C.set_introspect(I, '')
    13831386        I = I.replace('\\\n','')
    13841387        C._before_preparse = input + I