# 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:: |
54 | 54 | |
55 | 55 | Python classes:: |
56 | 56 | |
| 57 | sage: import sage.misc.attach |
57 | 58 | sage: sage_getfile(sage.misc.attach.Attach) |
58 | 59 | '.../attach.py' |
59 | 60 | |
60 | 61 | 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...' |
62 | 63 | |
63 | 64 | sage: sage_getsource(sage.misc.attach.Attach) |
64 | 65 | 'class Attach:...' |
diff --git a/sagenb/misc/support.py b/sagenb/misc/support.py
a
|
b
|
except ImportError: |
680 | 680 | |
681 | 681 | from sagenb.interfaces.format import displayhook_hack |
682 | 682 | |
683 | | def preparse_worksheet_cell(s): |
| 683 | def preparse_worksheet_cell(s, globals): |
684 | 684 | """ |
685 | 685 | Preparse the contents of a worksheet cell in the notebook, |
686 | 686 | respecting the user using ``preparser(False)`` to turn off the |
… |
… |
def preparse_worksheet_cell(s): |
697 | 697 | - string |
698 | 698 | """ |
699 | 699 | 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) |
701 | 701 | s = displayhook_hack(s) |
702 | 702 | if _automatic_names: |
703 | 703 | s = automatic_name_filter(s) |
diff --git a/sagenb/notebook/worksheet.py b/sagenb/notebook/worksheet.py
a
|
b
|
from sagenb.interfaces import (Worksheet |
39 | 39 | WorksheetProcess_RemoteExpectImplementation) |
40 | 40 | |
41 | 41 | |
42 | | from sagenb.misc.support import preparse_file |
43 | 42 | import sagenb.misc.support as support |
44 | 43 | |
45 | 44 | # Imports specifically relevant to the sage notebook |
… |
… |
from sagenb.notebook.all import * |
3623 | 3622 | return support.get_rightmost_identifier(s) |
3624 | 3623 | |
3625 | 3624 | 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) |
3627 | 3626 | |
3628 | 3627 | |
3629 | 3628 | ########################################################## |