Allow passing in traitlets via commandline

Without this, you *always* needed a repo2docker_config.py
file to configure anything. This PR makes r2d match the
behavior of most traitlets based applications (like jupyter_server,
jupyterhub, nbconvert, etc)

Fixes https://github.com/jupyterhub/repo2docker/issues/1112
pull/1123/head
YuviPanda 2022-01-26 14:45:38 +05:30
rodzic 6ab41efd4d
commit 885cb464b6
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -251,9 +251,10 @@ def make_r2d(argv=None):
print(__version__)
sys.exit(0)
args = get_argparser().parse_args(argv)
args, traitlet_args = get_argparser().parse_known_args(argv)
r2d = Repo2Docker()
r2d.parse_command_line(traitlet_args)
if args.debug:
r2d.log_level = logging.DEBUG

Wyświetl plik

@ -490,7 +490,7 @@ class Repo2Docker(Application):
extra=dict(phase="failed"),
)
def initialize(self):
def initialize(self, *args, **kwargs):
"""Init repo2docker configuration before start"""
# FIXME: Remove this function, move it to setters / traitlet reactors
if self.json_logs: