##// END OF EJS Templates
Fixing small things in response to review.
Brian Granger -
Show More
@@ -335,7 +335,7 b' class MultiEngine(ControllerAdapterBase):'
335 #---------------------------------------------------------------------------
335 #---------------------------------------------------------------------------
336 # IEngineMultiplexer methods
336 # IEngineMultiplexer methods
337 #---------------------------------------------------------------------------
337 #---------------------------------------------------------------------------
338
338
339 def execute(self, lines, targets='all'):
339 def execute(self, lines, targets='all'):
340 return self._performOnEnginesAndGatherBoth('execute', lines, targets=targets)
340 return self._performOnEnginesAndGatherBoth('execute', lines, targets=targets)
341
341
@@ -22,17 +22,19 b' pjoin = os.path.join'
22
22
23 from twisted.internet import reactor, defer
23 from twisted.internet import reactor, defer
24 from twisted.internet.protocol import ProcessProtocol
24 from twisted.internet.protocol import ProcessProtocol
25 from twisted.python import failure, log
26 from twisted.internet.error import ProcessDone, ProcessTerminated
25 from twisted.internet.error import ProcessDone, ProcessTerminated
27 from twisted.internet.utils import getProcessOutput
26 from twisted.internet.utils import getProcessOutput
27 from twisted.python import failure, log
28
28
29 from IPython.external import argparse
29 from IPython.external import argparse
30 from IPython.external import Itpl
30 from IPython.external import Itpl
31 from IPython.kernel.twistedutil import gatherBoth
32 from IPython.kernel.util import printer
33 from IPython.genutils import get_ipython_dir, num_cpus
31 from IPython.genutils import get_ipython_dir, num_cpus
34 from IPython.kernel.fcutil import have_crypto
32 from IPython.kernel.fcutil import have_crypto
35 from IPython.kernel.error import SecurityError
33 from IPython.kernel.error import SecurityError
34 from IPython.kernel.fcutil import have_crypto
35 from IPython.kernel.twistedutil import gatherBoth
36 from IPython.kernel.util import printer
37
36
38
37 #-----------------------------------------------------------------------------
39 #-----------------------------------------------------------------------------
38 # General process handling code
40 # General process handling code
@@ -44,10 +46,10 b' def find_exe(cmd):'
44 except ImportError:
46 except ImportError:
45 raise ImportError('you need to have pywin32 installed for this to work')
47 raise ImportError('you need to have pywin32 installed for this to work')
46 else:
48 else:
47 try:
49 try:
48 (path, offest) = win32api.SearchPath(os.environ['PATH'],cmd + '.exe')
50 (path, offest) = win32api.SearchPath(os.environ['PATH'],cmd + '.exe')
49 except:
51 except:
50 (path, offset) = win32api.SearchPath(os.environ['PATH'],cmd + '.bat')
52 (path, offset) = win32api.SearchPath(os.environ['PATH'],cmd + '.bat')
51 return path
53 return path
52
54
53 class ProcessStateError(Exception):
55 class ProcessStateError(Exception):
@@ -290,7 +292,7 b' class BatchEngineSet(object):'
290 f = open(self.batch_file,'w')
292 f = open(self.batch_file,'w')
291 f.write(script_as_string)
293 f.write(script_as_string)
292 f.close()
294 f.close()
293
295
294 def handle_error(self, f):
296 def handle_error(self, f):
295 f.printTraceback()
297 f.printTraceback()
296 f.raiseException()
298 f.raiseException()
@@ -302,7 +304,7 b' class BatchEngineSet(object):'
302 d.addCallback(self.parse_job_id)
304 d.addCallback(self.parse_job_id)
303 d.addErrback(self.handle_error)
305 d.addErrback(self.handle_error)
304 return d
306 return d
305
307
306 def kill(self):
308 def kill(self):
307 d = getProcessOutput(self.delete_command,
309 d = getProcessOutput(self.delete_command,
308 [self.job_id],env=os.environ)
310 [self.job_id],env=os.environ)
@@ -346,8 +348,8 b' def main_local(args):'
346 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
348 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
347
349
348 # Check security settings before proceeding
350 # Check security settings before proceeding
349 keep_going = check_security(args, cont_args)
351 if not check_security(args, cont_args):
350 if not keep_going: return
352 return
351
353
352 cl = ControllerLauncher(extra_args=cont_args)
354 cl = ControllerLauncher(extra_args=cont_args)
353 dstart = cl.start()
355 dstart = cl.start()
@@ -379,8 +381,8 b' def main_mpirun(args):'
379 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
381 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
380
382
381 # Check security settings before proceeding
383 # Check security settings before proceeding
382 keep_going = check_security(args, cont_args)
384 if not check_security(args, cont_args):
383 if not keep_going: return
385 return
384
386
385 cl = ControllerLauncher(extra_args=cont_args)
387 cl = ControllerLauncher(extra_args=cont_args)
386 dstart = cl.start()
388 dstart = cl.start()
@@ -416,8 +418,8 b' def main_pbs(args):'
416 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
418 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
417
419
418 # Check security settings before proceeding
420 # Check security settings before proceeding
419 keep_going = check_security(args, cont_args)
421 if not check_security(args, cont_args):
420 if not keep_going: return
422 return
421
423
422 cl = ControllerLauncher(extra_args=cont_args)
424 cl = ControllerLauncher(extra_args=cont_args)
423 dstart = cl.start()
425 dstart = cl.start()
General Comments 0
You need to be logged in to leave comments. Login now