parent
df8ea5f391
commit
1126b059b8
|
@ -1,10 +1,11 @@
|
|||
from buffer import Buffer
|
||||
from buffer import Buffer, ACT_NORM
|
||||
|
||||
# console is another singleton
|
||||
console = None
|
||||
class ConsoleBuffer(Buffer):
|
||||
btype = 'console'
|
||||
modename = 'ipython'
|
||||
#modename = 'ipython'
|
||||
modename = 'colortext'
|
||||
def __new__(cls, *args, **kwargs):
|
||||
global console
|
||||
if console is None:
|
||||
|
@ -15,7 +16,10 @@ class ConsoleBuffer(Buffer):
|
|||
Buffer.__init__(self)
|
||||
self.clear()
|
||||
def clear(self):
|
||||
lines = ['# Python Console\n',
|
||||
#lines = ['# Python Console\n',
|
||||
# "# Evaluate python expressions in the editor's context (self)\n",
|
||||
# '# Press Control-] to exit\n']
|
||||
lines = ['[r:d:*]# 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)
|
||||
|
@ -28,3 +32,11 @@ class ConsoleBuffer(Buffer):
|
|||
console = None
|
||||
def readonly(self):
|
||||
return True
|
||||
|
||||
#new
|
||||
def input_insert_lines(self, p, lines, act=ACT_NORM, force=False):
|
||||
pass
|
||||
def output_insert_lines(self, p, lines, act=ACT_NORM, force=False):
|
||||
pass
|
||||
def result_insert_lines(self, p, lines, act=ACT_NORM, force=False):
|
||||
pass
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,7 @@ class IpythonGrammar(Grammar):
|
|||
PatternRule(r'comment', r'#.*$'),
|
||||
RegionRule(r'string', r'"', StringGrammar2, r'"'),
|
||||
RegionRule(r'string', r"'", StringGrammar1, r"'"),
|
||||
RegionRule(r'ipython_input', r'^(?:>>>|\.\.>)', PythonGrammar, '\n$'),
|
||||
RegionRule(r'ipython_input', r'^(?:>>>|-->)', PythonGrammar, '\n$'),
|
||||
PatternRule(r'ipython_reserved', r'undef'),
|
||||
]
|
||||
class Ipython(mode.Fundamental):
|
||||
|
|
Loading…
Reference in New Issue