# 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
|
|
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 |
… |
… |
|
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 -r 09e2805309a3 -r 0bbc636ecc23 sagenb/notebook/worksheet.py
a
|
b
|
|
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 |
… |
… |
|
3624 | 3623 | return support.get_rightmost_identifier(s) |
3625 | 3624 | |
3626 | 3625 | 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) |
3628 | 3627 | |
3629 | 3628 | |
3630 | 3629 | ########################################################## |