From 087db8ae09f69dfe70e8b0c75b7ce0a5b2dca1c7 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 4 May 2022 21:18:51 +0200 Subject: allow specifying multiple addons, convert config to json before storing --- labbot/__main__.py | 2 +- labbot/config.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/labbot/__main__.py b/labbot/__main__.py index 551f0f1..f844503 100644 --- a/labbot/__main__.py +++ b/labbot/__main__.py @@ -36,7 +36,7 @@ def setup(**data): @click.argument('name') @click.option("--access_token", required=False, help="Access Token to interact with the API") @click.option("--secret", required=False, help="Secret to receive webhook requests (can be empty)") -@click.option("--addons", required=False, help="List of addons to load") +@click.option("--addons", multiple=True, required=False, help="List of addons to load") @click.option("--addon_path", required=False, help="Path to load custom addons from") @click.option("--print", is_flag=True, required=False, help="Print the current config with redacted values") def config(name, **data): diff --git a/labbot/config.py b/labbot/config.py index f372008..f3da425 100644 --- a/labbot/config.py +++ b/labbot/config.py @@ -29,6 +29,8 @@ def write_instance_config(name: str, data: dict) -> None: os.makedirs(instance_path, exist_ok=True) conf_path = os.path.join(instance_path, CONFIG_FILE) + data = json.loads(json.dumps(data)) + with open(conf_path, "w") as file: json.dump(data, file) -- cgit v1.2.3