From b9d3472df20d145b0717ab8f578033d8c4cf5d16 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 25 Jan 2021 11:14:50 +0000 Subject: added flag for -z --zipinput --- datamaps/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/datamaps/main.py b/datamaps/main.py index 444b56f..4efbfe7 100644 --- a/datamaps/main.py +++ b/datamaps/main.py @@ -148,6 +148,7 @@ def show_file(): @click.option( "--datamap", "-d", help="Path to datamap file", type=Path, metavar="CSV_FILE_PATH" ) +@click.option("--zipinput", "-z", help="Path to zip containing templates", type=Path, metavar="ZIP_PATH") @click.option( "--rowlimit", type=int, @@ -170,7 +171,7 @@ def show_file(): " option" ), ) -def templates(to_master, datamap, rowlimit, inputdir, validationonly): +def templates(to_master, datamap, zipinput, rowlimit, inputdir, validationonly): """Import data to a from populated templates. Import data from the template files stored in the input directory to create @@ -208,6 +209,9 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly): if datamap: if not datamap.is_absolute(): datamap = Path.cwd() / datamap + if zipinput: + if not zipinput.is_absolute(): + zipinput = Path.cwd() / zipinput if inputdir: if not inputdir.is_absolute(): inputdir = Path.cwd() / inputdir @@ -224,6 +228,7 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly): engine_cli.import_and_create_master( echo_funcs=output_funcs, datamap=datamap, + zipinput=zipinput, rowlimit=rowlimit, inputdir=inputdir, validationonly=validationonly, @@ -266,6 +271,7 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly): engine_cli.import_and_create_master( echo_funcs=output_funcs, datamap=datamap, + zipinput=zipinput, rowlimit=rowlimit, inputdir=inputdir, ) -- cgit v1.2.3