parent
692fc51706
commit
df8ea5f391
|
@ -4,7 +4,7 @@ from buffer import Buffer
|
|||
console = None
|
||||
class ConsoleBuffer(Buffer):
|
||||
btype = 'console'
|
||||
modename = 'console'
|
||||
modename = 'ipython'
|
||||
def __new__(cls, *args, **kwargs):
|
||||
global console
|
||||
if console is None:
|
||||
|
@ -15,9 +15,9 @@ class ConsoleBuffer(Buffer):
|
|||
Buffer.__init__(self)
|
||||
self.clear()
|
||||
def clear(self):
|
||||
lines = ['Python Console\n',
|
||||
"Evaluate python expressions in the editor's context (self)\n",
|
||||
'Press Control-] to exit\n']
|
||||
lines = ['# Python Console\n',
|
||||
"# Evaluate python expressions in the editor's context (self)\n",
|
||||
'# Press Control-] to exit\n']
|
||||
console.set_data(''.join(lines), force=True)
|
||||
def name(self):
|
||||
return '*Console*'
|
||||
|
|
|
@ -4,6 +4,7 @@ from mode.python import StringGrammar1, StringGrammar2, PythonGrammar
|
|||
|
||||
class IpythonGrammar(Grammar):
|
||||
rules = [
|
||||
PatternRule(r'comment', r'#.*$'),
|
||||
RegionRule(r'string', r'"', StringGrammar2, r'"'),
|
||||
RegionRule(r'string', r"'", StringGrammar1, r"'"),
|
||||
RegionRule(r'ipython_input', r'^(?:>>>|\.\.>)', PythonGrammar, '\n$'),
|
||||
|
|
Loading…
Reference in New Issue