diff --git a/IPython/Extensions/ipy_leo.py b/IPython/Extensions/ipy_leo.py index cd9028e..2cbc260 100644 --- a/IPython/Extensions/ipy_leo.py +++ b/IPython/Extensions/ipy_leo.py @@ -19,7 +19,7 @@ def init_ipython(ipy): """ global ip ip = ipy - ip.set_hook('complete_command', mb_completer, str_key = 'mb') + ip.set_hook('complete_command', mb_completer, str_key = '%mb') ip.expose_magic('mb',mb_f) ip.expose_magic('lee',lee_f) ip.expose_magic('leoref',leoref_f) diff --git a/IPython/Extensions/jobctrl.py b/IPython/Extensions/jobctrl.py index 9f87121..92dde58 100644 --- a/IPython/Extensions/jobctrl.py +++ b/IPython/Extensions/jobctrl.py @@ -133,20 +133,33 @@ else: def jobctrl_shellcmd(ip,cmd): """ os.system replacement that stores process info to db['tasks/t1234'] """ + cmd = cmd.strip() cmdname = cmd.split(None,1)[0] if cmdname in shell_internal_commands: use_shell = True else: use_shell = False - p = Popen(cmd,shell = use_shell) - jobentry = 'tasks/t' + str(p.pid) - + jobentry = None try: + try: + p = Popen(cmd,shell = use_shell) + except WindowsError: + if use_shell: + # try with os.system + os.system(cmd) + return + else: + # have to go via shell, sucks + p = Popen(cmd,shell = True) + + jobentry = 'tasks/t' + str(p.pid) ip.db[jobentry] = (p.pid,cmd,os.getcwd(),time.time()) - p.communicate() + p.communicate() + finally: - del ip.db[jobentry] + if jobentry: + del ip.db[jobentry] def install():