rossant / ipymd

Use the IPython notebook as an interactive Markdown editor
BSD 3-Clause "New" or "Revised" License
484 stars 42 forks source link

ipymd broken in IPython 4.0 #67

Closed rossant closed 9 years ago

rossant commented 9 years ago

jupyter notebook --NotebookApp.contents_manager_class=ipymd.IPymdContentsManager

error message:

[C 14:00:12.838 NotebookApp] Bad config encountered during initialization:
[C 14:00:12.838 NotebookApp] The 'contents_manager_class' trait of a NotebookApp 
instance must be a subclass of 'notebook.services.contents.manager.ContentsManager', 
but a value of class 'traitlets.traitlets.MetaHasTraits' 
(i.e. <class 'ipymd.core.contents_manager.IPymdContentsManager'>) 
was specified.

declaration of the class as follows:

class IPymdContentsManager(FileContentsManager, Configurable):

@carreau @minrk any ideas?

Carreau commented 9 years ago

Do a conditional import of FileContentsManager, Configurable

try:
   from traitlets.config import Configurable
Except ImportError:
   from IPython.traitlets.config....

Same with from notebook... import FileContensManager.

The class have the same name but have moved into another package. The importer probably don't like the shims, I had the same issue with jupyterdrive:

https://github.com/jupyter/jupyter-drive/blob/master/jupyterdrive/clientsidenbmanager.py#L8-L11

rossant commented 9 years ago

thanks @Carreau !