Show More
@@ -79,8 +79,14 class MultiKernelManager(LoggingConfigurable): | |||||
79 | return False |
|
79 | return False | |
80 |
|
80 | |||
81 | def start_kernel(self, **kwargs): |
|
81 | def start_kernel(self, **kwargs): | |
82 |
"""Start a new kernel. |
|
82 | """Start a new kernel. | |
83 | kernel_id = unicode(uuid.uuid4()) |
|
83 | ||
|
84 | The caller can pick a kernel_id by passing one in as a keyword arg, | |||
|
85 | otherwise one will be picked using a uuid. | |||
|
86 | """ | |||
|
87 | kernel_id = kwargs.pop('kernel_id', unicode(uuid.uuid4())) | |||
|
88 | if kernel_id in self: | |||
|
89 | raise DuplicateKernelError('Kernel already exists: %s' % kernel_id) | |||
84 | # use base KernelManager for each Kernel |
|
90 | # use base KernelManager for each Kernel | |
85 | km = self.kernel_manager_factory(connection_file=os.path.join( |
|
91 | km = self.kernel_manager_factory(connection_file=os.path.join( | |
86 | self.connection_dir, "kernel-%s.json" % kernel_id), |
|
92 | self.connection_dir, "kernel-%s.json" % kernel_id), |
General Comments 0
You need to be logged in to leave comments.
Login now