From 45f1185a2e219923e26bd58d06a1b5130720fa74 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 7 Sep 2022 13:09:39 +0200 Subject: Implement Dashboard --- labbot/__main__.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'labbot/__main__.py') diff --git a/labbot/__main__.py b/labbot/__main__.py index 39d8842..fa76c0f 100644 --- a/labbot/__main__.py +++ b/labbot/__main__.py @@ -12,7 +12,8 @@ import labbot.logger DEFAULT_ADDONS = [ "merge-label", "approve-merge", - "merge-stable" + "merge-stable", + "dashboard" ] @click.group() @@ -52,13 +53,12 @@ def config(name, **data): conf.update(data) labbot.config.write_instance_config(name, conf) click.echo("configured") - elif not print_config: - click.echo("run with `--help` to show usage") - - if print_config: - conf["access_token"] = "************" - conf["secret"] = "******" + elif print_config: + conf["access_token"] = (round(len(conf["access_token"]) / 4) * 4) * "*" + conf["secret"] = (round(len(conf["secret"]) / 4) * 4) * "*" click.echo(json.dumps(conf, indent=4)) + else: + click.echo("run with `--help` to show usage") else: click.echo(f"{name} is not an instance") pass @@ -82,11 +82,14 @@ def run(name, port: str, debug: bool): labbot.logger.init(logger_level) + access_token = conf.pop("access_token") + secret = conf.pop("secret", "") + instance = labbot.bot.Bot( name=name, config=conf, - secret=conf["secret"], - access_token=conf["access_token"] + access_token=access_token, + secret=secret, ) instance.run( -- cgit v1.2.3