Skip to content

Commit

Permalink
Merge pull request #650 from jhamrick/find-config
Browse files Browse the repository at this point in the history
Print warning when no config file is found
  • Loading branch information
jhamrick committed Jan 15, 2017
2 parents 8c316e1 + 9992860 commit 26bfc5b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nbgrader/apps/baseapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,22 @@ def _format_path(self, nbgrader_step, student_id, assignment_id, escape=False):

return path

def load_config_file(self, **kwargs):
"""Load the config file.
By default, errors in loading config are handled, and a warning
printed on screen. For testing, the suppress_errors option is set
to False, so errors will make tests fail.
"""
if self.config_file:
paths = [os.path.abspath("{}.py".format(self.config_file))]
else:
paths = [os.path.join(x, "{}.py".format(self.config_file_name)) for x in self.config_file_paths]

if not any(os.path.exists(x) for x in paths):
self.log.warn("No nbgrader_config.py file found (rerun with --debug to see where nbgrader is looking)")

super(NbGrader, self).load_config_file(**kwargs)


# These are the aliases and flags for nbgrader apps that inherit only from
# TransferApp
Expand Down

0 comments on commit 26bfc5b

Please sign in to comment.