##// END OF EJS Templates
ileo: %lee also takes input slices
Ville M. Vainio -
Show More
@@ -483,8 +483,9 b' def lee_f(self,s):'
483 483 """ Open file(s)/objects in Leo
484 484
485 485 - %lee hist -> open full session history in leo
486 - Takes an object
487 - Takes an mglob pattern, e.g. '%lee *.cpp' or %leo 'rec:*.cpp'
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 %lee 'rec:*.cpp'
488 - Takes input history indices: %lee 4 6-8 10 12-47
488 489 """
489 490 import os
490 491
@@ -496,6 +497,13 b' def lee_f(self,s):'
496 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 508 # try editing the object directly
501 509 obj = ip.user_ns.get(s, None)
@@ -503,6 +511,7 b' def lee_f(self,s):'
503 511 edit_object_in_leo(obj,s)
504 512 return
505 513
514
506 515 # if it's not object, it's a file name / mglob pattern
507 516 from IPython.external import mglob
508 517
General Comments 0
You need to be logged in to leave comments. Login now