From c9a953b177cf43a47f146e9d935447f54aaf148c Mon Sep 17 00:00:00 2001 From: Andreas Demmelbauer Date: Wed, 4 Apr 2018 15:22:34 -0700 Subject: [PATCH] more info if configpath not foundwq --- tootbot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tootbot.py b/tootbot.py index c48e414..e42dab9 100755 --- a/tootbot.py +++ b/tootbot.py @@ -16,12 +16,15 @@ from datetime import datetime, date, timedelta try: filedir = os.path.dirname(os.path.abspath(__file__)) if len(sys.argv) < 2: - print("Using default config location: %s/config.json" % filedir) - config = json.load(open(filedir+'/config.json')) + configpath = filedir+'/config.json' + print("Using default config location: ", configpath) + config = json.load(open(configpath)) else: - config = json.load(open(sys.argv[1])) + configpath = sys.argv[1] + config = json.load(open(configpath)) except: + print("didn't find config file: ", configpath) print("ERROR: Config file not found!") sys.exit(1)