##// END OF EJS Templates
define ESC_FOO consts only in inputsplitter...
MinRK -
Show More
@@ -79,7 +79,7 b' import sys'
79 79
80 80 from IPython.config.configurable import Configurable
81 81 from IPython.core.error import TryNext
82 from IPython.core.prefilter import ESC_MAGIC
82 from IPython.core.inputsplitter import ESC_MAGIC
83 83 from IPython.utils import generics
84 84 from IPython.utils import io
85 85 from IPython.utils.dir2 import dir2
@@ -91,6 +91,7 b" ESC_SH_CAP = '!!' # Send line to system shell and capture output"
91 91 ESC_HELP = '?' # Find information about object
92 92 ESC_HELP2 = '??' # Find extra-detailed information about object
93 93 ESC_MAGIC = '%' # Call magic function
94 ESC_MAGIC2 = '%%' # Call cell-magic function
94 95 ESC_QUOTE = ',' # Split args on whitespace, quote each as string and call
95 96 ESC_QUOTE2 = ';' # Quote all args as a single string, call
96 97 ESC_PAREN = '/' # Call first argument with rest of line as arguments
@@ -56,12 +56,12 b' from IPython.core.extensions import ExtensionManager'
56 56 from IPython.core.fakemodule import FakeModule, init_fakemod_dict
57 57 from IPython.core.formatters import DisplayFormatter
58 58 from IPython.core.history import HistoryManager
59 from IPython.core.inputsplitter import IPythonInputSplitter
59 from IPython.core.inputsplitter import IPythonInputSplitter, ESC_MAGIC, ESC_MAGIC2
60 60 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, ESC_CELL_MAGIC
64 from IPython.core.prefilter import PrefilterManager
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
@@ -1349,7 +1349,7 b' class InteractiveShell(SingletonConfigurable):'
1349 1349 oname = oname.strip()
1350 1350 #print '1- oname: <%r>' % oname # dbg
1351 1351 if not oname.startswith(ESC_MAGIC) and \
1352 not oname.startswith(ESC_CELL_MAGIC) and \
1352 not oname.startswith(ESC_MAGIC2) and \
1353 1353 not py3compat.isidentifier(oname, dotted=True):
1354 1354 return dict(found=False)
1355 1355
@@ -1409,8 +1409,8 b' class InteractiveShell(SingletonConfigurable):'
1409 1409 # Try to see if it's magic
1410 1410 if not found:
1411 1411 obj = None
1412 if oname.startswith(ESC_CELL_MAGIC):
1413 oname = oname.lstrip(ESC_CELL_MAGIC)
1412 if oname.startswith(ESC_MAGIC2):
1413 oname = oname.lstrip(ESC_MAGIC2)
1414 1414 obj = self.find_cell_magic(oname)
1415 1415 elif oname.startswith(ESC_MAGIC):
1416 1416 oname = oname.lstrip(ESC_MAGIC)
@@ -25,7 +25,7 b' from getopt import getopt, GetoptError'
25 25 from IPython.config.configurable import Configurable
26 26 from IPython.core import oinspect
27 27 from IPython.core.error import UsageError
28 from IPython.core.prefilter import ESC_MAGIC
28 from IPython.core.inputsplitter import ESC_MAGIC
29 29 from IPython.external.decorator import decorator
30 30 from IPython.utils.ipstruct import Struct
31 31 from IPython.utils.process import arg_split
@@ -20,8 +20,8 b' from pprint import pformat'
20 20
21 21 # Our own packages
22 22 from IPython.core.error import UsageError
23 from IPython.core.inputsplitter import ESC_MAGIC
23 24 from IPython.core.magic import Magics, magics_class, line_magic
24 from IPython.core.prefilter import ESC_MAGIC
25 25 from IPython.utils.text import format_screen
26 26 from IPython.core import magic_arguments, page
27 27 from IPython.testing.skipdoctest import skip_doctest
@@ -31,6 +31,16 b' import re'
31 31 from IPython.core.alias import AliasManager
32 32 from IPython.core.autocall import IPyAutocall
33 33 from IPython.config.configurable import Configurable
34 from IPython.core.inputsplitter import (
35 ESC_SHELL,
36 ESC_SH_CAP,
37 ESC_HELP,
38 ESC_MAGIC,
39 ESC_MAGIC2,
40 ESC_QUOTE,
41 ESC_QUOTE2,
42 ESC_PAREN,
43 )
34 44 from IPython.core.macro import Macro
35 45 from IPython.core.splitinput import split_user_input, LineInfo
36 46 from IPython.core import page
@@ -44,17 +54,6 b' from IPython.utils.autoattr import auto_attr'
44 54 # Global utilities, errors and constants
45 55 #-----------------------------------------------------------------------------
46 56
47 # Warning, these cannot be changed unless various regular expressions
48 # are updated in a number of places. Not great, but at least we told you.
49 ESC_SHELL = '!'
50 ESC_SH_CAP = '!!'
51 ESC_HELP = '?'
52 ESC_MAGIC = '%'
53 ESC_CELL_MAGIC = ESC_MAGIC * 2
54 ESC_QUOTE = ','
55 ESC_QUOTE2 = ';'
56 ESC_PAREN = '/'
57
58 57
59 58 class PrefilterError(Exception):
60 59 pass
General Comments 0
You need to be logged in to leave comments. Login now