##// END OF EJS Templates
add 'kill' to jobctrl
vivainio -
Show More
@@ -21,6 +21,7 b' README_Windows.txt'
21 21 """
22 22
23 23 from subprocess import Popen,PIPE
24 import os
24 25
25 26 from IPython import genutils
26 27
@@ -30,10 +31,14 b' class IpyPopen(Popen):'
30 31 def go(self):
31 32 print self.communicate()[0]
32 33 def __repr__(self):
33 return '<IPython job "%s">' % self.line
34 return '<IPython job "%s" PID=%d>' % (self.line, self.pid)
35
36 def kill(self):
37 assert os.name == 'nt' # xxx add posix version
38 os.system('taskkill /PID %d' % self.pid)
34 39
35 40 def startjob(job):
36 p = IpyPopen(job, stdout=PIPE)
41 p = IpyPopen(job, stdout=PIPE, shell = False)
37 42 p.line = job
38 43 return p
39 44
General Comments 0
You need to be logged in to leave comments. Login now