File: shutdown.py

package info (click to toggle)
jupyter-notebook 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,444 kB
  • sloc: javascript: 23,377; python: 15,064; makefile: 252; sh: 66
file content (15 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""HTTP handler to shut down the notebook server.
"""
from tornado import web, ioloop
from notebook.base.handlers import IPythonHandler

class ShutdownHandler(IPythonHandler):
    @web.authenticated
    def post(self):
        self.log.info("Shutting down on /api/shutdown request.")
        ioloop.IOLoop.current().stop()


default_handlers = [
    (r"/api/shutdown", ShutdownHandler),
]