##// END OF EJS Templates
ileo: %lee also takes input slices
Ville M. Vainio -
Show More
@@ -483,11 +483,12 b' def lee_f(self,s):'
483 """ Open file(s)/objects in Leo
483 """ Open file(s)/objects in Leo
484
484
485 - %lee hist -> open full session history in leo
485 - %lee hist -> open full session history in leo
486 - Takes an object
486 - Takes an object. l = [1,2,"hello"]; %lee l. Alt+I in leo pushes the object back
487 - Takes an mglob pattern, e.g. '%lee *.cpp' or %leo 'rec:*.cpp'
487 - Takes an mglob pattern, e.g. '%lee *.cpp' or %lee 'rec:*.cpp'
488 - Takes input history indices: %lee 4 6-8 10 12-47
488 """
489 """
489 import os
490 import os
490
491
491 c.beginUpdate()
492 c.beginUpdate()
492 try:
493 try:
493 if s == 'hist':
494 if s == 'hist':
@@ -496,12 +497,20 b' def lee_f(self,s):'
496 return
497 return
497
498
498
499
500 if s and s[0].isdigit():
501 # numbers; push input slices to leo
502 lines = self.extract_input_slices(s.strip().split(), True)
503 v = add_var('stored_ipython_input')
504 v.b = '\n'.join(lines)
505 return
506
499
507
500 # try editing the object directly
508 # try editing the object directly
501 obj = ip.user_ns.get(s, None)
509 obj = ip.user_ns.get(s, None)
502 if obj is not None:
510 if obj is not None:
503 edit_object_in_leo(obj,s)
511 edit_object_in_leo(obj,s)
504 return
512 return
513
505
514
506 # if it's not object, it's a file name / mglob pattern
515 # if it's not object, it's a file name / mglob pattern
507 from IPython.external import mglob
516 from IPython.external import mglob
General Comments 0
You need to be logged in to leave comments. Login now