From 7b40882d9f12ae5ef2c8b01ad21392d554fa68c1 Mon Sep 17 00:00:00 2001 From: Kevin Hannegan Date: Wed, 18 Nov 2020 14:11:17 +0000 Subject: [PATCH 1/2] fix cli bugs --- CHANGELOG.md | 5 +++++ presalytics/cli.py | 11 +++++++++-- setup.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f358342..81db622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.5.23 + +* Fix cli initial pull in empty workspace +* Fix cli default to CACHE_TOKENS = True + ## v0.5.22 (2020-10-13) * Add events handling to widgets with nested iframes diff --git a/presalytics/cli.py b/presalytics/cli.py index 6639ab5..2ff8fe4 100644 --- a/presalytics/cli.py +++ b/presalytics/cli.py @@ -371,6 +371,8 @@ def main(): #load story outline from file if config: set_dict = {} if not args.set else parse_vars(args.set) + if 'CACHE_TOKENS' not in set_dict.keys(): + set_dict['CACHE_TOKENS'] = True presalytics.lib.tools.workflows.create_config_file(args.username, password=args.password, set_dict=set_dict, @@ -385,8 +387,13 @@ def main(): if os.path.exists(abs_filename): filename = abs_filename else: - logger.error("Could not find file: {}".format(filename)) - return + if pull and args.id: + outline = presalytics.lib.tools.workflows.pull_outline(args.id, username=args.username, password=args.password) + _dump(outline, filename, args.overwrite, args.json) + pull = False + else: + logger.error("Could not find file: {}".format(filename)) + return outline = _load_file(filename) except Exception: logger.error("Error handling file: {}".format(filename)) diff --git a/setup.py b/setup.py index f25fd39..d071195 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "presalytics" -VERSION = "0.5.22" +VERSION = "0.5.23" # To install the library, run the following # From 5d80b78562126feeeb49af4738e2c1aed12dce3a Mon Sep 17 00:00:00 2001 From: kevin-presalytics Date: Mon, 7 Dec 2020 07:04:18 -0800 Subject: [PATCH 2/2] fix overwrite error --- CHANGELOG.md | 4 ++++ presalytics/cli.py | 1 + setup.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81db622..e62f349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.5.24 + +* Eliminate overwrite error in cli + ## v0.5.23 * Fix cli initial pull in empty workspace diff --git a/presalytics/cli.py b/presalytics/cli.py index 2ff8fe4..815b6bb 100644 --- a/presalytics/cli.py +++ b/presalytics/cli.py @@ -391,6 +391,7 @@ def main(): outline = presalytics.lib.tools.workflows.pull_outline(args.id, username=args.username, password=args.password) _dump(outline, filename, args.overwrite, args.json) pull = False + write = False else: logger.error("Could not find file: {}".format(filename)) return diff --git a/setup.py b/setup.py index d071195..26bcf07 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "presalytics" -VERSION = "0.5.23" +VERSION = "0.5.24" # To install the library, run the following #