Skip to content

Commit

Permalink
Extract out kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Nov 30, 2022
1 parent 5965c7f commit cc7c77f
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 2,154 deletions.
8 changes: 8 additions & 0 deletions jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ def contents_manager(self):

@property
def session_manager(self):
if "session_manager" not in self.settings:
self.settings["session_manager"] = self.settings["session_manager_class"](
parent=self.serverapp,
log=self.settings["log"],
kernel_manager=self.settings["kernel_manager"],
contents_manager=self.contents_manager,
)

return self.settings["session_manager"]

@property
Expand Down
8 changes: 4 additions & 4 deletions jupyter_server/base/zmqhandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Raise a warning that this module is deprecated.
import warnings

from tornado.websocket import WebSocketHandler

from jupyter_server.base.websocket import WebSocketMixin
from jupyter_server.services.kernels.connection.base import (
from jupyter_server_kernels.kernels.connection.base import (
deserialize_binary_message,
deserialize_msg_from_ws_v1,
serialize_binary_message,
serialize_msg_to_ws_v1,
)
from tornado.websocket import WebSocketHandler

from jupyter_server.base.websocket import WebSocketMixin

warnings.warn(
"jupyter_server.base.zmqhandlers module is deprecated in Jupyter Server 2.0",
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/gateway/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
from jupyter_client.kernelspec import KernelSpecManager
from jupyter_client.manager import AsyncKernelManager
from jupyter_client.managerabc import KernelManagerABC
from jupyter_server_kernels.kernels.kernelmanager import AsyncMappingKernelManager
from tornado import web
from tornado.escape import json_decode, json_encode, url_escape, utf8
from traitlets import DottedObjectName, Instance, Type, default

from .._tz import UTC
from ..services.kernels.kernelmanager import AsyncMappingKernelManager
from ..services.sessions.sessionmanager import SessionManager
from ..utils import ensure_async, url_path_join
from .gateway_client import GatewayClient, gateway_request
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/kernelspecs/handlers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from jupyter_server_kernels.kernelspecs.handlers import kernel_name_regex
from tornado import web

from jupyter_server.auth import authorized

from ..base.handlers import JupyterHandler
from ..services.kernelspecs.handlers import kernel_name_regex

AUTH_RESOURCE = "kernelspecs"

Expand Down
Loading

0 comments on commit cc7c77f

Please sign in to comment.