From fde1c6e26b14dc000ccf41d8099749a05195270e Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 2 Feb 2017 00:16:34 +0100 Subject: [PATCH] handle self.config_dir and self.config_file_name in server_extensions could be important for subclasses --- notebook/notebookapp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index d4f7ef6d2..058eaa1ac 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1238,8 +1238,12 @@ class NotebookApp(JupyterApp): # This enables merging on keys, which we want for extension enabling,. # Regular config loading only merges at the class level, # so each level (use > env > system) clobbers the previous. - manager = ConfigManager(read_config_path=jupyter_config_path()) - section = manager.get('jupyter_notebook_config') + config_path = jupyter_config_path() + if self.config_dir not in config_path: + # add self.config_dir to the front, if set manually + config_path.insert(0, self.config_dir) + manager = ConfigManager(read_config_path=config_path) + section = manager.get(self.config_file_name) extensions = section.get('NotebookApp', {}).get('nbserver_extensions', {}) for modulename, enabled in self.nbserver_extensions.items():