aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2021-01-13 12:14:30 +0000
committerMatthew Lemon <matt@matthewlemon.com>2021-01-13 12:14:30 +0000
commit12a3053f0dab49bbb6bcbd9d7571b35c5927f5d6 (patch)
tree3e4ca69e0d00295844278cab1a0d945c59763d5e
parent3bce6707dd7f536ea23d223b49114cc818ca348d (diff)
added datamap config command
-rw-r--r--datamaps/__init__.py2
-rw-r--r--datamaps/main.py33
-rw-r--r--setup.py2
3 files changed, 29 insertions, 8 deletions
diff --git a/datamaps/__init__.py b/datamaps/__init__.py
index 9e604c0..e13bd59 100644
--- a/datamaps/__init__.py
+++ b/datamaps/__init__.py
@@ -1 +1 @@
-__version__ = "1.0.7"
+__version__ = "1.0.8"
diff --git a/datamaps/main.py b/datamaps/main.py
index 2bdf938..06c4512 100644
--- a/datamaps/main.py
+++ b/datamaps/main.py
@@ -103,6 +103,29 @@ def report():
"""Create a report"""
+@cli.group("config")
+def _config():
+ """Manage datamaps configuration."""
+
+
+@_config.command(
+ help="Removes the configuration file (config.ini). It will be restored "
+ "automatically with default settings when required. You will lose any custom "
+ "configuration, but this is a good troubleshooting step."
+ )
+def restart():
+ """Removes the configuration file (config.ini)."""
+ engine_cli.delete_config(engine_config)
+
+
+@_config.command()
+def show_file():
+ """
+ Shows location of the config.ini file.
+ """
+ engine_cli.show_config_file(engine_config)
+
+
@_import.command()
@click.option(
"--to-master",
@@ -110,12 +133,10 @@ def report():
is_flag=True,
default=False,
help="Create master.xlsx based on populated templates in output directory. "
- "Future versions will allow importing to other formats such as databases, "
- "hence the reason for this being the only option currently.",
-)
-@click.option(
- "--datamap", "-d", help="Path to datamap file", metavar="CSV_FILE_PATH"
+ "Future versions will allow importing to other formats such as databases, "
+ "hence the reason for this being the only option currently.",
)
+@click.option("--datamap", "-d", help="Path to datamap file", metavar="CSV_FILE_PATH")
def templates(to_master, datamap):
"""Import data to a master file from a collection of populated templates.
@@ -128,7 +149,7 @@ def templates(to_master, datamap):
TEMPLATE ROW LIMIT
- By default there is a row limit of 500 when importing from a template, which means only cells in
+ By default there is a row limit of 500 when importing from a template, which means only cells in
rows 1-500 will be imported, no matter what your datamap says. This prevents datamaps running out of
memory when faced with a spreadsheet containing errenous/invisible rows, which can occur without the
user being aware, particularly on templates that have been subjected to length edits, years of copy
diff --git a/setup.py b/setup.py
index 36769bd..c7cb960 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ setup(
install_requires=[
'click',
'python-dateutil',
- 'bcompiler-engine>=1.0.7'
+ 'bcompiler-engine>=1.0.8'
# "bcompiler-engine @ git+https://github.com/hammerheadlemon/bcompiler-engine@datamaps-cli-opt"
],
test_suite='datamaps.tests')