diff --git a/IPython/Extensions/ipy_leo.py b/IPython/Extensions/ipy_leo.py index eb09a71..5e0ebc0 100644 --- a/IPython/Extensions/ipy_leo.py +++ b/IPython/Extensions/ipy_leo.py @@ -255,3 +255,30 @@ def leo_f(self,s): c.endUpdate() ip.expose_magic('leo',leo_f) + +def leoref_f(self,s): + import textwrap + print textwrap.dedent("""\ + %leo file - open file in leo + wb.foo.v - eval node foo (i.e. headstring is 'foo' or '@ipy foo') + wb.foo.v = 12 - assign to body of node foo + wb.foo.b - read or write the body of node foo + wb.foo.l - body of node foo as string list + + for el in wb.foo: + print el.v + + + """ + ) +ip.expose_magic('leoref',leoref_f) + +def show_welcome(): + print "------------------" + print "Welcome to Leo-enabled IPython session!" + print "Try %leoref for quick reference." + import IPython.platutils + IPython.platutils.set_term_title('Leo IPython') + IPython.platutils.freeze_term_title() +show_welcome() + diff --git a/IPython/platutils_posix.py b/IPython/platutils_posix.py index ef80ad6..a1d60ad 100644 --- a/IPython/platutils_posix.py +++ b/IPython/platutils_posix.py @@ -37,4 +37,5 @@ if os.environ.get('TERM','') == 'xterm': else: set_term_title = _dummy_op +freeze_term_title = _dummy_op diff --git a/IPython/platutils_win32.py b/IPython/platutils_win32.py index 364afbc..76e5333 100644 --- a/IPython/platutils_win32.py +++ b/IPython/platutils_win32.py @@ -50,4 +50,7 @@ def set_term_title(title): return _set_term_title(title) +def freeze_term_title(): + global ignore_termtitle + ignore_termtitle = 1