From 0dede72692973c7d9749ac01e943e2210249b14c Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Fri, 25 Nov 2022 15:38:20 -0800 Subject: [PATCH] Re-add --only-set-cv-key feature --- comictaggerlib/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/comictaggerlib/main.py b/comictaggerlib/main.py index a512926..ce0d9b1 100755 --- a/comictaggerlib/main.py +++ b/comictaggerlib/main.py @@ -160,6 +160,16 @@ See https://github.com/comictagger/comictagger/releases/1.5.5 for more informati file=sys.stderr, ) + # manage the CV API key + # None comparison is used so that the empty string can unset the value + if opts.cv_api_key is not None or opts.cv_url is not None: + settings.cv_api_key = opts.cv_api_key if opts.cv_api_key is not None else settings.cv_api_key + settings.cv_url = opts.cv_url if opts.cv_url is not None else settings.cv_url + settings.save() + if opts.only_set_cv_key: + print("Key set") # noqa: T201 + return + signal.signal(signal.SIGINT, signal.SIG_DFL) logger.info(