Skip to content

Commit

Permalink
Fix config file loading in nbconvert.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau authored and minrk committed Jun 5, 2015
1 parent db36b31 commit af934bb
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,21 @@ def load_config_file(self, suppress_errors=True):
"""
self.log.debug("Searching %s for config files", self.config_file_paths)
base_config = 'jupyter_config'
self.log.debug("Attempting to load config file: %s" %
base_config)
try:
Application.load_config_file(
self,
super(JupyterApp, self).load_config_file(
base_config,
path=self.config_file_paths
)
except ConfigFileNotFound:
# ignore errors loading parent
self.log.debug("Config file %s not found", base_config)
pass

for config_file_name in self.config_files:
from itertools import chain
for config_file_name in chain(self.config_file_name, self.config_files):
if not config_file_name or config_file_name == base_config:
continue
self.log.debug("Attempting to load config file: %s" %
self.config_file)
try:
Application.load_config_file(
self,
super(JupyterApp, self).load_config_file(
config_file_name,
path=self.config_file_paths
)
Expand All @@ -183,7 +177,8 @@ def load_config_file(self, suppress_errors=True):
if not suppress_errors:
raise
self.log.warn("Error loading config file: %s" %
self.config_file, exc_info=True)
config_file_name, exc_info=True)

# subcommand-related
def _find_subcommand(self, name):
name = '{}-{}'.format(self.name, name)
Expand Down

0 comments on commit af934bb

Please sign in to comment.