@@ -51,31 +51,31 @@ except NameError:
51
51
52
52
def km_from_string (s ):
53
53
" ""create kernel manager from IPKernelApp string
54
- such as ' --shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for 0.11
55
- or just ' kernel-12345.json' for 0.12
54
+ such as ' --shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for IPython 0.11
55
+ or just ' kernel-12345.json' for IPython 0.12
56
56
" ""
57
57
from os.path import join as pjoin
58
58
from IPython.zmq.blockingkernelmanager import BlockingKernelManager, Empty
59
59
from IPython.config.loader import KeyValueConfigLoader
60
60
from IPython.zmq.kernelapp import kernel_aliases
61
61
global km ,send,Empty
62
62
63
+ s = s .replace (' --existing' , ' ' )
63
64
if ' connection_file' in BlockingKernelManager.class_trait_names ():
64
65
from IPython.lib.kernel import find_connection_file
65
66
# 0.12 uses files instead of a collection of ports
66
67
# include default IPython search path
67
68
# filefind also allows for absolute paths, in which case the search
68
69
# is ignored
69
70
try :
70
- fullpath = find_connection_file (s )
71
+ fullpath = find_connection_file (s . lstrip (). rstrip () )
71
72
except IOError,e :
72
73
echo (" :IPython " + s + " failed" , " Info" )
73
74
echo (" ^-- failed --" + s + " not found" , " Error" )
74
75
return
75
76
km = BlockingKernelManager (connection_file = fullpath)
76
77
km .load_connection_file ()
77
78
else :
78
- s = s .replace (' --existing' , ' ' )
79
79
loader = KeyValueConfigLoader (s .split (), aliases= kernel_aliases)
80
80
cfg = loader.load_config ()[' KernelApp' ]
81
81
try :
0 commit comments