##// END OF EJS Templates
ipykit: PyLauncher first arg strip
vivainio -
Show More
@@ -12,7 +12,7 b' def pylaunchers():'
12 .ipy files will be run like macros.
12 .ipy files will be run like macros.
13
13
14 """
14 """
15 fs = glob.glob('*.?py*')
15 fs = glob.glob('*.py') + glob.glob('*.ipy')
16 for f in fs:
16 for f in fs:
17 l = PyLauncher(f)
17 l = PyLauncher(f)
18 n = os.path.splitext(f)[0]
18 n = os.path.splitext(f)[0]
@@ -51,7 +51,14 b' class PyLauncher:'
51 if self.script.endswith('.ipy'):
51 if self.script.endswith('.ipy'):
52 ip.runlines(open(self.script).read())
52 ip.runlines(open(self.script).read())
53 else:
53 else:
54 selflaunch("py " + self.script + ' ' + line)
54 # first word is the script/alias name itself, strip it
55 tup = line.split(None,1)
56 if len(tup) == 2:
57 tail = ' ' + tup[1]
58 else:
59 tail = ''
60
61 selflaunch(ip,"py " + self.script + tail)
55 def __repr__(self):
62 def __repr__(self):
56 return 'PyLauncher("%s")' % self.script
63 return 'PyLauncher("%s")' % self.script
57
64
General Comments 0
You need to be logged in to leave comments. Login now