branch : pmacs2
This commit is contained in:
moculus 2009-02-23 02:51:31 +00:00
parent df8ea5f391
commit 1126b059b8
3 changed files with 38580 additions and 4 deletions

View File

@ -1,10 +1,11 @@
from buffer import Buffer from buffer import Buffer, ACT_NORM
# console is another singleton # console is another singleton
console = None console = None
class ConsoleBuffer(Buffer): class ConsoleBuffer(Buffer):
btype = 'console' btype = 'console'
modename = 'ipython' #modename = 'ipython'
modename = 'colortext'
def __new__(cls, *args, **kwargs): def __new__(cls, *args, **kwargs):
global console global console
if console is None: if console is None:
@ -15,7 +16,10 @@ class ConsoleBuffer(Buffer):
Buffer.__init__(self) Buffer.__init__(self)
self.clear() self.clear()
def clear(self): 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", "# Evaluate python expressions in the editor's context (self)\n",
'# Press Control-] to exit\n'] '# Press Control-] to exit\n']
console.set_data(''.join(lines), force=True) console.set_data(''.join(lines), force=True)
@ -28,3 +32,11 @@ class ConsoleBuffer(Buffer):
console = None console = None
def readonly(self): def readonly(self):
return True 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

38564
code_examples/screen.mbox Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ class IpythonGrammar(Grammar):
PatternRule(r'comment', r'#.*$'), PatternRule(r'comment', r'#.*$'),
RegionRule(r'string', r'"', StringGrammar2, r'"'), RegionRule(r'string', r'"', StringGrammar2, r'"'),
RegionRule(r'string', r"'", StringGrammar1, 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'), PatternRule(r'ipython_reserved', r'undef'),
] ]
class Ipython(mode.Fundamental): class Ipython(mode.Fundamental):