Skip to content

Commit 885cb46

Browse files
committed
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 #1112
1 parent 6ab41ef commit 885cb46

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

repo2docker/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ def make_r2d(argv=None):
251251
print(__version__)
252252
sys.exit(0)
253253

254-
args = get_argparser().parse_args(argv)
254+
args, traitlet_args = get_argparser().parse_known_args(argv)
255255

256256
r2d = Repo2Docker()
257+
r2d.parse_command_line(traitlet_args)
257258

258259
if args.debug:
259260
r2d.log_level = logging.DEBUG

repo2docker/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def json_excepthook(self, etype, evalue, traceback):
490490
extra=dict(phase="failed"),
491491
)
492492

493-
def initialize(self):
493+
def initialize(self, *args, **kwargs):
494494
"""Init repo2docker configuration before start"""
495495
# FIXME: Remove this function, move it to setters / traitlet reactors
496496
if self.json_logs:

0 commit comments

Comments
 (0)