Made generated config look a little nicer
This commit is contained in:
parent
f37840ef01
commit
a64a1a8e96
|
@ -6,9 +6,5 @@
|
||||||
"mention_handling": 1,
|
"mention_handling": 1,
|
||||||
"max_thread_length": 15,
|
"max_thread_length": 15,
|
||||||
"strip_paired_punctuation": false,
|
"strip_paired_punctuation": false,
|
||||||
"website": "https://git.nixnet.services/amber/amber-ebooks",
|
"website": "https://git.nixnet.services/amber/amber-ebooks"
|
||||||
"client": {
|
|
||||||
"id": "placeholder string",
|
|
||||||
"secret": "placeholder string"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
3
main.py
3
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)))
|
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)
|
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):
|
def extract_toot(toot):
|
||||||
toot = functions.extract_toot(toot)
|
toot = functions.extract_toot(toot)
|
||||||
|
|
Reference in New Issue