Commit 437fbd2c authored by Matthieu Boileau's avatar Matthieu Boileau

Simple userconf to test notebook dir

parent d24e76fb
Pipeline #7632 passed with stage
in 1 minute and 51 seconds
...@@ -11,7 +11,7 @@ from .mydoit import MyDoitHelp, ClassTaskLoader ...@@ -11,7 +11,7 @@ from .mydoit import MyDoitHelp, ClassTaskLoader
def get_help_epilog() -> str: def get_help_epilog() -> str:
"""Instanciate a minimal nbcourse to return help string""" """Instanciate a minimal nbcourse to return help string"""
course = NbCourse(help=True) course = NbCourse()
loader = ClassTaskLoader(course) loader = ClassTaskLoader(course)
return MyDoitHelp(task_loader=loader).get_help() return MyDoitHelp(task_loader=loader).get_help()
......
...@@ -65,7 +65,7 @@ class NbCourse: ...@@ -65,7 +65,7 @@ class NbCourse:
}] }]
} }
def __init__(self, user_conf=None, help=False): def __init__(self, user_conf=None):
"""Build from user_conf""" """Build from user_conf"""
self.conf = self._get_config(user_conf) self.conf = self._get_config(user_conf)
self.conf['template_path'] = Path(self.conf['theme']['dir'], self.conf['template_path'] = Path(self.conf['theme']['dir'],
...@@ -82,7 +82,7 @@ class NbCourse: ...@@ -82,7 +82,7 @@ class NbCourse:
nbcourse_libdir = Path(__file__).parents[1] nbcourse_libdir = Path(__file__).parents[1]
self.conf['reveal_path'] = nbcourse_libdir / Path('reveal.js') self.conf['reveal_path'] = nbcourse_libdir / Path('reveal.js')
self.notebooks = tuple(self.conf['nb']['path'].glob('*-*.ipynb')) self.notebooks = tuple(self.conf['nb']['path'].glob('*-*.ipynb'))
if not help and not self.notebooks: if user_conf and not self.notebooks:
log.error("No notebooks found!\n" + \ log.error("No notebooks found!\n" + \
"Check 'nb:dir:' field in nbcourse.yml file.") "Check 'nb:dir:' field in nbcourse.yml file.")
sys.exit() sys.exit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment