##// END OF EJS Templates
ipy_leo: lock term title (makes the right ipython session easy to find) + brief %leoref
Ville M. Vainio -
Show More
@@ -255,3 +255,30 b' def leo_f(self,s):'
255 c.endUpdate()
255 c.endUpdate()
256
256
257 ip.expose_magic('leo',leo_f)
257 ip.expose_magic('leo',leo_f)
258
259 def leoref_f(self,s):
260 import textwrap
261 print textwrap.dedent("""\
262 %leo file - open file in leo
263 wb.foo.v - eval node foo (i.e. headstring is 'foo' or '@ipy foo')
264 wb.foo.v = 12 - assign to body of node foo
265 wb.foo.b - read or write the body of node foo
266 wb.foo.l - body of node foo as string list
267
268 for el in wb.foo:
269 print el.v
270
271
272 """
273 )
274 ip.expose_magic('leoref',leoref_f)
275
276 def show_welcome():
277 print "------------------"
278 print "Welcome to Leo-enabled IPython session!"
279 print "Try %leoref for quick reference."
280 import IPython.platutils
281 IPython.platutils.set_term_title('Leo IPython')
282 IPython.platutils.freeze_term_title()
283 show_welcome()
284
@@ -37,4 +37,5 b" if os.environ.get('TERM','') == 'xterm':"
37 else:
37 else:
38 set_term_title = _dummy_op
38 set_term_title = _dummy_op
39
39
40 freeze_term_title = _dummy_op
40
41
@@ -50,4 +50,7 b' def set_term_title(title):'
50 return
50 return
51 _set_term_title(title)
51 _set_term_title(title)
52
52
53 def freeze_term_title():
54 global ignore_termtitle
55 ignore_termtitle = 1
53
56
General Comments 0
You need to be logged in to leave comments. Login now