From a64a1a8e96a8b144de82a3b99bd29f55cd73aec3 Mon Sep 17 00:00:00 2001 From: Amber Date: Mon, 21 Mar 2022 21:48:03 -0500 Subject: [PATCH] Made generated config look a little nicer --- config.def.json | 6 +----- main.py | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/config.def.json b/config.def.json index 4eeb4e0..861542e 100644 --- a/config.def.json +++ b/config.def.json @@ -6,9 +6,5 @@ "mention_handling": 1, "max_thread_length": 15, "strip_paired_punctuation": false, - "website": "https://git.nixnet.services/amber/amber-ebooks", - "client": { - "id": "placeholder string", - "secret": "placeholder string" - } + "website": "https://git.nixnet.services/amber/amber-ebooks" } diff --git a/main.py b/main.py index e0a11b7..f573a33 100755 --- a/main.py +++ b/main.py @@ -62,7 +62,8 @@ if "secret" not in cfg: print("Open this URL and authenticate to give mstdn-ebooks access to your bot's account: {}".format(client.auth_request_url(scopes=scopes))) cfg['secret'] = client.log_in(code=input("Secret: "), scopes=scopes) -json.dump(cfg, open(args.cfg, "w+")) +#json.dump(cfg, open(args.cfg, "w+")) +open(args.cfg, "w").write(re.sub(",", ",\n", json.dumps(cfg))) def extract_toot(toot): toot = functions.extract_toot(toot)