From 6e2bdb0c8d042bb9bff93c9e090d79323d58bad9 Mon Sep 17 00:00:00 2001 From: gabe Date: Mon, 27 Sep 2021 14:52:02 -0500 Subject: [PATCH] Caught a few errors. --- ASCIIsite.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ASCIIsite.py b/ASCIIsite.py index 50c9479..d0ad22a 100755 --- a/ASCIIsite.py +++ b/ASCIIsite.py @@ -45,11 +45,19 @@ def parse_arguments(): logging.info(f'outputting to {outFile.resolve()}') logging.debug(f'compress is {compress}') - with open(args.exclude_file, 'r') as file: - exclude=[glob.strip() for glob in file] + try: + with open(args.exclude_file, 'r') as file: + exclude=[glob.strip() for glob in file] - if args.exclude != None: - exclude.extend(args.exclude) + if args.exclude != None: + exclude.extend(args.exclude) + except Exception as e: + print(str(e)) + exit() + + if args.inputDir.resolve().exists(): + print(f'Inputdir {args.inputDir.resolve()} does not exist!') + exit() return args.inputDir.resolve(), outFile, compress, exclude