Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Update hybridmanager.py
Browse files Browse the repository at this point in the history
This is the very same example as for danielfrg/s3contents#163
  • Loading branch information
djuarezg authored May 4, 2023
1 parent 789403f commit 4727348
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hybridcontents/hybridmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
from six import iteritems
from tornado.web import HTTPError

from notebook.services.contents.manager import ContentsManager
# Ref. https://github.com/jupyter/nbdime/blob/c82362344e596efdc4f54c927d90338940e0fa41/nbdime/webapp/nb_server_extension.py#L16-L33
# This allows solving conflicts between the class import from either notebook or jupyter_server
try:
from notebook.services.contents.manager import ContentsManager
except ModuleNotFoundError:
pass

try:
from jupyter_server.services.contents.manager import ContentsManager
except ModuleNotFoundError:
pass

from traitlets import Dict

Expand Down

0 comments on commit 4727348

Please sign in to comment.