Show More
@@ -61,6 +61,12 b' from zmqshell import ZMQInteractiveShell' | |||||
61 | # Main kernel class |
|
61 | # Main kernel class | |
62 | #----------------------------------------------------------------------------- |
|
62 | #----------------------------------------------------------------------------- | |
63 |
|
63 | |||
|
64 | # Change this when incrementing the kernel protocol version | |||
|
65 | version_major = 1 | |||
|
66 | version_minor = 1 | |||
|
67 | version = '{0}.{1}'.format(version_major, version_minor) | |||
|
68 | ||||
|
69 | ||||
64 | class Kernel(Configurable): |
|
70 | class Kernel(Configurable): | |
65 |
|
71 | |||
66 | #--------------------------------------------------------------------------- |
|
72 | #--------------------------------------------------------------------------- | |
@@ -156,6 +162,7 b' class Kernel(Configurable):' | |||||
156 | # Build dict of handlers for message types |
|
162 | # Build dict of handlers for message types | |
157 | msg_types = [ 'execute_request', 'complete_request', |
|
163 | msg_types = [ 'execute_request', 'complete_request', | |
158 | 'object_info_request', 'history_request', |
|
164 | 'object_info_request', 'history_request', | |
|
165 | 'version_request', | |||
159 | 'connect_request', 'shutdown_request', |
|
166 | 'connect_request', 'shutdown_request', | |
160 | 'apply_request', |
|
167 | 'apply_request', | |
161 | ] |
|
168 | ] | |
@@ -509,6 +516,16 b' class Kernel(Configurable):' | |||||
509 | content, parent, ident) |
|
516 | content, parent, ident) | |
510 | self.log.debug("%s", msg) |
|
517 | self.log.debug("%s", msg) | |
511 |
|
518 | |||
|
519 | def version_request(self, stream, ident, parent): | |||
|
520 | vinfo = { | |||
|
521 | 'version': version, | |||
|
522 | 'version_major': version_major, | |||
|
523 | 'version_minor': version_minor, | |||
|
524 | } | |||
|
525 | msg = self.session.send(stream, 'version_reply', | |||
|
526 | vinfo, parent, ident) | |||
|
527 | self.log.debug("%s", msg) | |||
|
528 | ||||
512 | def shutdown_request(self, stream, ident, parent): |
|
529 | def shutdown_request(self, stream, ident, parent): | |
513 | self.shell.exit_now = True |
|
530 | self.shell.exit_now = True | |
514 | content = dict(status='ok') |
|
531 | content = dict(status='ok') |
General Comments 0
You need to be logged in to leave comments.
Login now