Skip to content

Commit 9fd486e

Browse files
committed
Integrate outputs manager into extension app.
1 parent d23e9f7 commit 9fd486e

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

jupyter_rtc_core/app.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .handlers import RouteHandler, YRoomSessionHandler, FileIDIndexHandler
77
from .websockets import GlobalAwarenessWebsocket, YRoomWebsocket
88
from .rooms.yroom_manager import YRoomManager
9+
from .outputs import OutputsManager, outputs_handlers
910

1011
class RtcExtensionApp(ExtensionApp):
1112
name = "jupyter_rtc_core"
@@ -25,6 +26,9 @@ class RtcExtensionApp(ExtensionApp):
2526
(r"api/fileid/index", FileIDIndexHandler)
2627
]
2728

29+
for handler in outputs_handlers:
30+
handlers.append(handler)
31+
2832
yroom_manager_class = Type(
2933
klass=YRoomManager,
3034
help="""YRoom Manager Class.""",
@@ -37,6 +41,17 @@ class RtcExtensionApp(ExtensionApp):
3741
allow_none=True
3842
).tag(config=True)
3943

44+
outputs_manager_class = Type(
45+
klass=OutputsManager,
46+
help="Outputs manager class.",
47+
default_value=OutputsManager
48+
).tag(config=True)
49+
50+
outputs_manager = Instance(
51+
klass=OutputsManager,
52+
help="An instance of the OutputsManager",
53+
allow_none=True
54+
).tag(config=True)
4055

4156
def initialize(self):
4257
super().initialize()
@@ -59,7 +74,10 @@ def get_fileid_manager():
5974
loop=loop,
6075
log=log
6176
)
62-
pass
77+
78+
# Initialize OutputsManager
79+
self.outputs_manager = self.outputs_manager_class(config=self.config)
80+
self.settings["outputs_manager"] = self.outputs_manager
6381

6482

6583
def _link_jupyter_server_extension(self, server_app):

jupyter_rtc_core/outputs/manager.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,10 @@
77

88
from traitlets.config import LoggingConfigurable
99
from traitlets import (
10-
Any,
11-
Bool,
1210
Dict,
1311
Instance,
14-
List,
15-
TraitError,
16-
Type,
17-
Unicode,
1812
Int,
19-
default,
20-
validate,
13+
default
2114
)
2215

2316
from jupyter_core.paths import jupyter_runtime_dir

0 commit comments

Comments
 (0)