Show More
@@ -60,7 +60,7 b' class Kernel(HasTraits):' | |||||
60 |
|
60 | |||
61 | # Build dict of handlers for message types |
|
61 | # Build dict of handlers for message types | |
62 | msg_types = [ 'execute_request', 'complete_request', |
|
62 | msg_types = [ 'execute_request', 'complete_request', | |
63 | 'object_info_request' ] |
|
63 | 'object_info_request', 'shutdown_request' ] | |
64 | self.handlers = {} |
|
64 | self.handlers = {} | |
65 | for msg_type in msg_types: |
|
65 | for msg_type in msg_types: | |
66 | self.handlers[msg_type] = getattr(self, msg_type) |
|
66 | self.handlers[msg_type] = getattr(self, msg_type) | |
@@ -163,6 +163,14 b' class Kernel(HasTraits):' | |||||
163 | object_info, parent, ident) |
|
163 | object_info, parent, ident) | |
164 | print >> sys.__stdout__, msg |
|
164 | print >> sys.__stdout__, msg | |
165 |
|
165 | |||
|
166 | def shutdown_request(self, ident, parent): | |||
|
167 | content = dict(parent['content']) | |||
|
168 | msg = self.session.send(self.reply_socket, 'shutdown_reply', | |||
|
169 | content, parent, ident) | |||
|
170 | print >> sys.__stdout__, msg | |||
|
171 | time.sleep(0.1) | |||
|
172 | sys.exit(0) | |||
|
173 | ||||
166 | #--------------------------------------------------------------------------- |
|
174 | #--------------------------------------------------------------------------- | |
167 | # Protected interface |
|
175 | # Protected interface | |
168 | #--------------------------------------------------------------------------- |
|
176 | #--------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now