From 2b2824a73ea3acb27e39faf37d703df5123a25b8 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sun, 12 May 2019 00:54:27 +1000 Subject: [PATCH] don't create a client when simulating --- gen.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gen.py b/gen.py index aa762e3..208b2f8 100755 --- a/gen.py +++ b/gen.py @@ -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()