##// END OF EJS Templates
oinfo finds cell magics with same name as line magics...
MinRK -
Show More
@@ -61,7 +61,7 b' from IPython.core.logger import Logger'
61 61 from IPython.core.macro import Macro
62 62 from IPython.core.payload import PayloadManager
63 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 65 from IPython.core.profiledir import ProfileDir
66 66 from IPython.core.pylabtools import pylab_activate
67 67 from IPython.core.prompts import PromptManager
@@ -1348,7 +1348,9 b' class InteractiveShell(SingletonConfigurable):'
1348 1348 """
1349 1349 oname = oname.strip()
1350 1350 #print '1- oname: <%r>' % oname # dbg
1351 if not py3compat.isidentifier(oname.lstrip(ESC_MAGIC), dotted=True):
1351 if not oname.startswith(ESC_MAGIC) and \
1352 not oname.startswith(ESC_CELL_MAGIC) and \
1353 not py3compat.isidentifier(oname, dotted=True):
1352 1354 return dict(found=False)
1353 1355
1354 1356 alias_ns = None
@@ -1406,11 +1408,18 b' class InteractiveShell(SingletonConfigurable):'
1406 1408
1407 1409 # Try to see if it's magic
1408 1410 if not found:
1409 if oname.startswith(ESC_MAGIC):
1410 oname = oname.lstrip(ESC_MAGIC)
1411 obj = self.find_line_magic(oname)
1412 if obj is None:
1411 obj = None
1412 if oname.startswith(ESC_CELL_MAGIC):
1413 oname = oname.lstrip(ESC_CELL_MAGIC)
1413 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 1423 if obj is not None:
1415 1424 found = True
1416 1425 ospace = 'IPython internal'
@@ -50,6 +50,7 b" ESC_SHELL = '!'"
50 50 ESC_SH_CAP = '!!'
51 51 ESC_HELP = '?'
52 52 ESC_MAGIC = '%'
53 ESC_CELL_MAGIC = ESC_MAGIC * 2
53 54 ESC_QUOTE = ','
54 55 ESC_QUOTE2 = ';'
55 56 ESC_PAREN = '/'
General Comments 0
You need to be logged in to leave comments. Login now