Show More
@@ -449,11 +449,20 b' class NotebookApp(BaseIPythonApplication):' | |||||
449 | self.port = port |
|
449 | self.port = port | |
450 | break |
|
450 | break | |
451 |
|
451 | |||
|
452 | def init_signal(self): | |||
|
453 | signal.signal(signal.SIGINT, self._handle_signal) | |||
|
454 | signal.signal(signal.SIGTERM, self._handle_signal) | |||
|
455 | ||||
|
456 | def _handle_signal(self, sig, frame): | |||
|
457 | self.log.critical("received signal %s, stopping", sig) | |||
|
458 | ioloop.IOLoop.instance().stop() | |||
|
459 | ||||
452 | @catch_config_error |
|
460 | @catch_config_error | |
453 | def initialize(self, argv=None): |
|
461 | def initialize(self, argv=None): | |
454 | super(NotebookApp, self).initialize(argv) |
|
462 | super(NotebookApp, self).initialize(argv) | |
455 | self.init_configurables() |
|
463 | self.init_configurables() | |
456 | self.init_webapp() |
|
464 | self.init_webapp() | |
|
465 | self.init_signal() | |||
457 |
|
466 | |||
458 | def cleanup_kernels(self): |
|
467 | def cleanup_kernels(self): | |
459 | """shutdown all kernels |
|
468 | """shutdown all kernels |
General Comments 0
You need to be logged in to leave comments.
Login now