From ba469906acce9df6504d27876348bb262bc6bb6d Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Fri, 20 Nov 2020 16:49:03 +0100 Subject: [PATCH] Add `--template` option to optimade-client CLI --- optimade_client/cli/run.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/optimade_client/cli/run.py b/optimade_client/cli/run.py index 37d0a8a8..5c4fb310 100644 --- a/optimade_client/cli/run.py +++ b/optimade_client/cli/run.py @@ -44,11 +44,17 @@ def main(args: list = None): action="store_true", help="Attempt to open a browser upon starting the VoilĂ  tornado server.", ) + parser.add_argument( + "--template", + type=str, + help="Use another template than the default.", + ) args = parser.parse_args(args) log_level = args.log_level debug = args.debug open_browser = args.open_browser + template = args.template # Make sure VoilĂ  is installed if voila is None: @@ -88,4 +94,7 @@ def main(args: list = None): if "--debug" not in argv: argv.append(f"--Voila.log_level={getattr(logging, log_level.upper())}") + if template: + argv.append(f"--template={template}") + voila(argv)