don't create a client when simulating

This commit is contained in:
Lynne 2019-05-12 00:54:27 +10:00
parent 8fe30f0c88
commit 2b2824a73e
No known key found for this signature in database
GPG Key ID: FB7B970303ACE499
1 changed files with 8 additions and 5 deletions

13
gen.py
View File

@ -15,11 +15,14 @@ args = parser.parse_args()
cfg = json.load(open('config.json'))
client = Mastodon(
client_id=cfg['client']['id'],
client_secret=cfg['client']['secret'],
access_token=cfg['secret'],
api_base_url=cfg['site'])
client = None
if not args.simulate:
client = Mastodon(
client_id=cfg['client']['id'],
client_secret=cfg['client']['secret'],
access_token=cfg['secret'],
api_base_url=cfg['site'])
if __name__ == '__main__':
toot = functions.make_toot()