mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Merge pull request #289 from minrk/nbextension-install
relative import of ConfigManager
This commit is contained in:
commit
6bd83883a3
@ -338,7 +338,7 @@ class EnableNBExtensionApp(JupyterApp):
|
||||
|
||||
def enable_nbextension(self, name):
|
||||
# Local import to avoid circular import issue on Py 2
|
||||
from notebook.services.config import ConfigManager
|
||||
from .services.config import ConfigManager
|
||||
cm = ConfigManager(parent=self, config=self.config)
|
||||
cm.update(self.section, {"load_extensions": {name: True}})
|
||||
|
||||
@ -369,7 +369,7 @@ class DisableNBExtensionApp(JupyterApp):
|
||||
|
||||
def disable_nbextension(self, name):
|
||||
# Local import to avoid circular import issue on Py 2
|
||||
from notebook.services.config import ConfigManager
|
||||
from .services.config import ConfigManager
|
||||
cm = ConfigManager(parent=self, config=self.config)
|
||||
if name not in cm.get(self.section).get('load_extensions', {}):
|
||||
sys.exit('{} is not enabled in section {}'.format(name, self.section))
|
||||
|
Loading…
Reference in New Issue
Block a user