Ticket #7514: sagenb-7514.patch

File sagenb-7514.patch, 1.8 KB (added by was, 11 years ago)
  • sagenb/misc/support.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1258877600 28800
    # Node ID 0bbc636ecc236ee50f50a56c57489635ce92b6fc
    # Parent  09e2805309a3750583330e75d097357225146997
    trac 7514 -- rewrite load and attach
    
    diff -r 09e2805309a3 -r 0bbc636ecc23 sagenb/misc/support.py
    a b  
    680680
    681681from sagenb.interfaces.format import displayhook_hack
    682682
    683 def preparse_worksheet_cell(s):
     683def preparse_worksheet_cell(s, globals):
    684684    """
    685685    Preparse the contents of a worksheet cell in the notebook,
    686686    respecting the user using ``preparser(False)`` to turn off the
     
    697697        - string
    698698    """
    699699    if do_preparse():
    700         s = preparse_file(s, magic=True, do_time=True, ignore_prompts=False, reload_attached=True)
     700        s = preparse_file(s, globals=globals)
    701701    s = displayhook_hack(s)
    702702    if _automatic_names:
    703703        s = automatic_name_filter(s)
  • sagenb/notebook/worksheet.py

    diff -r 09e2805309a3 -r 0bbc636ecc23 sagenb/notebook/worksheet.py
    a b  
    3939                               WorksheetProcess_RemoteExpectImplementation)
    4040
    4141                         
    42 from sagenb.misc.support import preparse_file
    4342import sagenb.misc.support  as support
    4443
    4544# Imports specifically relevant to the sage notebook
     
    36243623        return support.get_rightmost_identifier(s)
    36253624
    36263625    def preparse(self, s):
    3627         return 'exec _support_.preparse_worksheet_cell(base64.b64decode("%s"))'%base64.b64encode(s)
     3626        return 'exec _support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())'%base64.b64encode(s)
    36283627   
    36293628   
    36303629    ##########################################################