Show More
@@ -61,7 +61,7 b' from IPython.core.logger import Logger' | |||||
61 | from IPython.core.macro import Macro |
|
61 | from IPython.core.macro import Macro | |
62 | from IPython.core.payload import PayloadManager |
|
62 | from IPython.core.payload import PayloadManager | |
63 | from IPython.core.plugin import PluginManager |
|
63 | from IPython.core.plugin import PluginManager | |
64 | from IPython.core.prefilter import PrefilterManager, ESC_MAGIC |
|
64 | from IPython.core.prefilter import PrefilterManager, ESC_MAGIC, ESC_CELL_MAGIC | |
65 | from IPython.core.profiledir import ProfileDir |
|
65 | from IPython.core.profiledir import ProfileDir | |
66 | from IPython.core.pylabtools import pylab_activate |
|
66 | from IPython.core.pylabtools import pylab_activate | |
67 | from IPython.core.prompts import PromptManager |
|
67 | from IPython.core.prompts import PromptManager | |
@@ -1348,7 +1348,9 b' class InteractiveShell(SingletonConfigurable):' | |||||
1348 | """ |
|
1348 | """ | |
1349 | oname = oname.strip() |
|
1349 | oname = oname.strip() | |
1350 | #print '1- oname: <%r>' % oname # dbg |
|
1350 | #print '1- oname: <%r>' % oname # dbg | |
1351 |
if not |
|
1351 | if not oname.startswith(ESC_MAGIC) and \ | |
|
1352 | not oname.startswith(ESC_CELL_MAGIC) and \ | |||
|
1353 | not py3compat.isidentifier(oname, dotted=True): | |||
1352 | return dict(found=False) |
|
1354 | return dict(found=False) | |
1353 |
|
1355 | |||
1354 | alias_ns = None |
|
1356 | alias_ns = None | |
@@ -1406,11 +1408,18 b' class InteractiveShell(SingletonConfigurable):' | |||||
1406 |
|
1408 | |||
1407 | # Try to see if it's magic |
|
1409 | # Try to see if it's magic | |
1408 | if not found: |
|
1410 | if not found: | |
1409 | if oname.startswith(ESC_MAGIC): |
|
1411 | obj = None | |
1410 |
|
|
1412 | if oname.startswith(ESC_CELL_MAGIC): | |
1411 | obj = self.find_line_magic(oname) |
|
1413 | oname = oname.lstrip(ESC_CELL_MAGIC) | |
1412 | if obj is None: |
|
|||
1413 | obj = self.find_cell_magic(oname) |
|
1414 | obj = self.find_cell_magic(oname) | |
|
1415 | elif oname.startswith(ESC_MAGIC): | |||
|
1416 | oname = oname.lstrip(ESC_MAGIC) | |||
|
1417 | obj = self.find_line_magic(oname) | |||
|
1418 | else: | |||
|
1419 | # search without prefix, so run? will find %run? | |||
|
1420 | obj = self.find_line_magic(oname) | |||
|
1421 | if obj is None: | |||
|
1422 | obj = self.find_cell_magic(oname) | |||
1414 | if obj is not None: |
|
1423 | if obj is not None: | |
1415 | found = True |
|
1424 | found = True | |
1416 | ospace = 'IPython internal' |
|
1425 | ospace = 'IPython internal' |
@@ -50,6 +50,7 b" ESC_SHELL = '!'" | |||||
50 | ESC_SH_CAP = '!!' |
|
50 | ESC_SH_CAP = '!!' | |
51 | ESC_HELP = '?' |
|
51 | ESC_HELP = '?' | |
52 | ESC_MAGIC = '%' |
|
52 | ESC_MAGIC = '%' | |
|
53 | ESC_CELL_MAGIC = ESC_MAGIC * 2 | |||
53 | ESC_QUOTE = ',' |
|
54 | ESC_QUOTE = ',' | |
54 | ESC_QUOTE2 = ';' |
|
55 | ESC_QUOTE2 = ';' | |
55 | ESC_PAREN = '/' |
|
56 | ESC_PAREN = '/' |
General Comments 0
You need to be logged in to leave comments.
Login now