diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-09-07 13:09:39 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-09-07 13:09:39 +0200 |
commit | 45f1185a2e219923e26bd58d06a1b5130720fa74 (patch) | |
tree | 53d2a333b2dcfc48af3ebc903b7c5be1a380d1a2 /labbot/__main__.py | |
parent | c7c3468f044acb58f8e3e3341c42135a08e0d380 (diff) | |
download | lab-bot-45f1185a2e219923e26bd58d06a1b5130720fa74.tar.gz lab-bot-45f1185a2e219923e26bd58d06a1b5130720fa74.zip |
Implement Dashboard
Diffstat (limited to 'labbot/__main__.py')
-rw-r--r-- | labbot/__main__.py | 21 |
1 files changed, 12 insertions, 9 deletions
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( |