diff --git a/nbclassic/nbserver.py b/nbclassic/nbserver.py index 61c896189..60979a7d0 100644 --- a/nbclassic/nbserver.py +++ b/nbclassic/nbserver.py @@ -96,6 +96,7 @@ def sorted_extensions(self): return {key: self.extensions[key] for key in keys} manager.__class__.sorted_extensions = property(sorted_extensions) + print("\n\nDid this work 2? \n\n") # Look to see if nbclassic is enabled. if so, # link the nbclassic extension here to load @@ -109,16 +110,22 @@ def sorted_extensions(self): except Exception: nbapp = NotebookAppTraits() + print("\n\nDid this work 3? \n\n") + # Proxy NotebookApp traits through serverapp to notebookapp. members = diff_members(serverapp, nbapp) for m in members: proxy(serverapp, nbapp, m) + print("\n\nDid this work 4? \n\n") + # Find jupyter server extensions listed as notebook server extensions. jupyter_paths = jupyter_config_path() config_dirs = jupyter_paths + [serverapp.config_dir] nbserver_extensions = get_nbserver_extensions(config_dirs) + print("\n\nDid this work 5? \n\n") + # Link all extensions found in the old locations for # notebook server extensions. for name, enabled in nbserver_extensions.items(): @@ -135,6 +142,9 @@ def sorted_extensions(self): ) manager.link_extension(name, serverapp) + print("\n\nDid this work 6? \n\n") + + # Monkey-patch Jupyter Server's template and static path list to include # the classic notebooks template folder. Since there are some # redundancy in the template names between these two packages, @@ -151,6 +161,9 @@ def template_file_path(self): notebook.DEFAULT_TEMPLATE_PATH_LIST + \ jupyter_server.DEFAULT_TEMPLATE_PATH_LIST + print("\n\nDid this work 7? \n\n") + + serverapp.__class__.template_file_path = property(template_file_path) print(f"\n\ntemplate path: {serverapp.__class__.template_file_path}\n\n") @@ -160,6 +173,9 @@ def static_file_path_jupyter_server(self): serverapp.__class__.static_file_path = property(static_file_path_jupyter_server) + print("\n\nDid this work 8? \n\n") + + def static_file_path_nbclassic(self): """return extra paths + the default location""" # NBExtensions look for classic notebook static files under the `/static/notebook/...` @@ -172,6 +188,8 @@ def static_file_path_nbclassic(self): nbapp.__class__.static_file_path = property(static_file_path_nbclassic) + print("\n\nDid this work 9? \n\n") + def _load_jupyter_server_extension(serverapp): # Patch the config service manager to find the