From 593f1d3b3ca2fe93ae809ca2f82c13995db4c94b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 25 Jan 2021 20:55:00 +0000 Subject: now handles --inputdir and --zipinput and NestedZipError --- datamaps/__init__.py | 2 +- datamaps/main.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/datamaps/__init__.py b/datamaps/__init__.py index a82b376..72f26f5 100644 --- a/datamaps/__init__.py +++ b/datamaps/__init__.py @@ -1 +1 @@ -__version__ = "1.1.1" +__version__ = "1.1.2" diff --git a/datamaps/main.py b/datamaps/main.py index 4efbfe7..6029ae9 100644 --- a/datamaps/main.py +++ b/datamaps/main.py @@ -36,6 +36,7 @@ from engine.exceptions import ( NoApplicableSheetsInTemplateFiles, RemoveFileWithNoSheetRequiredByDatamap, DatamapNotCSVException, + NestedZipError ) logging.basicConfig( @@ -218,6 +219,9 @@ def templates(to_master, datamap, zipinput, rowlimit, inputdir, validationonly): if rowlimit == 0: logging.critical("Row limit cannot be 0. Quitting.") sys.exit(1) + if zipinput and inputdir: + logging.critical("Cannot select both --inputdir and --zipinput/-z flags.") + sys.exit(1) if to_master and validationonly: logging.critical( "Cannot select both -m/--to-master and -v/--validationonly flags." @@ -265,6 +269,9 @@ def templates(to_master, datamap, zipinput, rowlimit, inputdir, validationonly): except DatamapNotCSVException as e: logger.critical(e) sys.exit(1) + except NestedZipError as e: + logger.critical(e) + sys.exit(1) if to_master: try: @@ -307,6 +314,9 @@ def templates(to_master, datamap, zipinput, rowlimit, inputdir, validationonly): except DatamapNotCSVException as e: logger.critical(e) sys.exit(1) + except NestedZipError as e: + logger.critical(e) + sys.exit(1) @export.command() -- cgit v1.2.3