Show More
@@ -35,6 +35,7 b' from zmq.eventloop import ioloop' | |||||
35 | from zmq.eventloop.zmqstream import ZMQStream |
|
35 | from zmq.eventloop.zmqstream import ZMQStream | |
36 |
|
36 | |||
37 | # Local imports |
|
37 | # Local imports | |
|
38 | import IPython | |||
38 | from IPython.config.configurable import Configurable |
|
39 | from IPython.config.configurable import Configurable | |
39 | from IPython.config.application import boolean_flag, catch_config_error |
|
40 | from IPython.config.application import boolean_flag, catch_config_error | |
40 | from IPython.core.application import ProfileDir |
|
41 | from IPython.core.application import ProfileDir | |
@@ -53,7 +54,7 b' from IPython.utils.traitlets import (' | |||||
53 | from entry_point import base_launch_kernel |
|
54 | from entry_point import base_launch_kernel | |
54 | from kernelapp import KernelApp, kernel_flags, kernel_aliases |
|
55 | from kernelapp import KernelApp, kernel_flags, kernel_aliases | |
55 | from serialize import serialize_object, unpack_apply_message |
|
56 | from serialize import serialize_object, unpack_apply_message | |
56 | from session import Session, Message |
|
57 | from session import Session, Message, protocol_version | |
57 | from zmqshell import ZMQInteractiveShell |
|
58 | from zmqshell import ZMQInteractiveShell | |
58 |
|
59 | |||
59 |
|
60 | |||
@@ -61,10 +62,8 b' from zmqshell import ZMQInteractiveShell' | |||||
61 | # Main kernel class |
|
62 | # Main kernel class | |
62 | #----------------------------------------------------------------------------- |
|
63 | #----------------------------------------------------------------------------- | |
63 |
|
64 | |||
64 | # Change this when incrementing the kernel protocol version |
|
65 | ipython_version = list(IPython.version_info) | |
65 | version_major = 1 |
|
66 | language_version = list(sys.version_info[:3]) | |
66 | version_minor = 1 |
|
|||
67 | version = '{0}.{1}'.format(version_major, version_minor) |
|
|||
68 |
|
67 | |||
69 |
|
68 | |||
70 | class Kernel(Configurable): |
|
69 | class Kernel(Configurable): | |
@@ -518,9 +517,10 b' class Kernel(Configurable):' | |||||
518 |
|
517 | |||
519 | def version_request(self, stream, ident, parent): |
|
518 | def version_request(self, stream, ident, parent): | |
520 | vinfo = { |
|
519 | vinfo = { | |
521 | 'version': version, |
|
520 | 'protocol_version': protocol_version, | |
522 |
'version |
|
521 | 'ipython_version': ipython_version, | |
523 |
'version |
|
522 | 'language_version': language_version, | |
|
523 | 'language': 'python', | |||
524 | } |
|
524 | } | |
525 | msg = self.session.send(stream, 'version_reply', |
|
525 | msg = self.session.send(stream, 'version_reply', | |
526 | vinfo, parent, ident) |
|
526 | vinfo, parent, ident) |
@@ -75,6 +75,9 b' def squash_unicode(obj):' | |||||
75 | # globals and defaults |
|
75 | # globals and defaults | |
76 | #----------------------------------------------------------------------------- |
|
76 | #----------------------------------------------------------------------------- | |
77 |
|
77 | |||
|
78 | # Change this when incrementing the kernel protocol version | |||
|
79 | protocol_version = [1, 1] | |||
|
80 | ||||
78 | _version_info_list = list(IPython.version_info) |
|
81 | _version_info_list = list(IPython.version_info) | |
79 | # ISO8601-ify datetime objects |
|
82 | # ISO8601-ify datetime objects | |
80 | json_packer = lambda obj: jsonapi.dumps(obj, default=date_default) |
|
83 | json_packer = lambda obj: jsonapi.dumps(obj, default=date_default) |
@@ -197,9 +197,10 b' class CompleteReply(Reference):' | |||||
197 |
|
197 | |||
198 |
|
198 | |||
199 | class VersionReply(Reference): |
|
199 | class VersionReply(Reference): | |
200 | version = Enum((ipkernel.version)) |
|
200 | protocol_version = Enum((ipkernel.protocol_version,)) | |
201 |
version |
|
201 | ipython_version = Enum((ipkernel.ipython_version,)) | |
202 |
version |
|
202 | language_version = Enum((ipkernel.language_version,)) | |
|
203 | language = Enum(("python",)) | |||
203 |
|
204 | |||
204 |
|
205 | |||
205 | # IOPub messages |
|
206 | # IOPub messages |
General Comments 0
You need to be logged in to leave comments.
Login now