diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2019-10-13 17:03:40 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2019-10-13 17:03:40 +0100 |
commit | 80b63fc9200a3ff660c20efc4f29e848053a7f23 (patch) | |
tree | 6801f1f2b66bbe3018f71497576d66146b0081a5 | |
parent | d1c2e52b16f5148eb1ec1c833774d2afd5937bbe (diff) |
some better help text and catching RunTimeError related to commit 2c58250 in engine
-rw-r--r-- | datamaps/__init__.py | 2 | ||||
-rw-r--r-- | datamaps/main.py | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/datamaps/__init__.py b/datamaps/__init__.py index 77eaf59..bd25841 100644 --- a/datamaps/__init__.py +++ b/datamaps/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0b9" +__version__ = "1.0.0b10" diff --git a/datamaps/main.py b/datamaps/main.py index 0cc4218..c58de94 100644 --- a/datamaps/main.py +++ b/datamaps/main.py @@ -59,7 +59,11 @@ pass_config = click.make_pass_decorator(Config, ensure=True) @pass_config def cli(config, verbose): """ - datamaps is a tool for moving data to and from spreadsheets. See web site, etc. + datamaps is a tool for moving data to and from spreadsheets. Documentation available + at https://www.datamaps.twentyfoursoftware.com (comming soon). + + Please note: datamaps is beta software! Development is ongoing and the program + is undergoing continuous change. """ config.verbose = verbose @@ -74,7 +78,8 @@ def _import(): @cli.group("export") def export(): """ - Export something (master data to blank templates, etc). + Export data from one format to another. Current functionality allows for data + to be exported from a Master spreadsheet to one or many blank Templates. """ @@ -111,8 +116,13 @@ def templates(to_master): @export.command() # @click.argument("datamap") # @click.argument("blank") -@click.argument("master") +@click.argument("master", metavar="FILE_PATH") def master(master): + """Export data from a Master file + + Export data from master file whose path is FILE_PATH to a series of + blank Template files. + """ engine_config.initialise() input_dir = engine_config.PLATFORM_DOCS_DIR / "input" @@ -123,11 +133,12 @@ def master(master): blank = input_dir / blank_fn datamap = input_dir / datamap_fn - click.secho(f"Exporting master {master} to templates based on {blank}...") +# click.secho(f"Exporting master {master} to templates based on {blank}...") + be_logger.info(f"Exporting master {master} to templates based on {blank}...") try: engine_cli.write_master_to_templates(blank, datamap, master) - except FileNotFoundError as e: + except (FileNotFoundError, RuntimeError) as e: click.secho(str(e), fg="red") |