Ticket #7514: sagenb-7514.2.patch

File sagenb-7514.2.patch, 2.4 KB (added by mpatel, 11 years ago)

Fixed doctest failures. Replaces previous.

  • sagenb/misc/sageinspect.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1258877600 28800
    # Node ID de934190ae569f79bf08af784309ddc4421132e7
    # Parent  65b488f71a8f1fbbc315e9ff39ef10bbd0eb1401
    trac 7514 -- rewrite load and attach
    
    diff --git a/sagenb/misc/sageinspect.py b/sagenb/misc/sageinspect.py
    a b Cython classes:: 
    5454
    5555Python classes::
    5656
     57    sage: import sage.misc.attach
    5758    sage: sage_getfile(sage.misc.attach.Attach)
    5859    '.../attach.py'
    5960
    6061    sage: sage_getdoc(sage.misc.attach.Attach).lstrip()
    61     "Attach a file to a running instance of Sage..."
     62    'Attach a file to a running instance of Sage...'
    6263
    6364    sage: sage_getsource(sage.misc.attach.Attach)
    6465    'class Attach:...'
  • sagenb/misc/support.py

    diff --git a/sagenb/misc/support.py b/sagenb/misc/support.py
    a b except ImportError: 
    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
    def preparse_worksheet_cell(s): 
    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 --git a/sagenb/notebook/worksheet.py b/sagenb/notebook/worksheet.py
    a b from sagenb.interfaces import (Worksheet 
    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
    from sagenb.notebook.all import * 
    36233622        return support.get_rightmost_identifier(s)
    36243623
    36253624    def preparse(self, s):
    3626         return 'exec _support_.preparse_worksheet_cell(base64.b64decode("%s"))'%base64.b64encode(s)
     3625        return 'exec _support_.preparse_worksheet_cell(base64.b64decode("%s"),globals())'%base64.b64encode(s)
    36273626   
    36283627   
    36293628    ##########################################################