[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-survey] 02/02: upgrade/fix config logic
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-survey] 02/02: upgrade/fix config logic |
Date: |
Mon, 27 May 2019 18:42:14 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository survey.
commit 7c898b3153c22a03d39bcb9e649c8d130ea1b92e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon May 27 18:42:07 2019 +0200
upgrade/fix config logic
---
taler-merchant-survey.in | 2 +-
talersurvey/talerconfig.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/taler-merchant-survey.in b/taler-merchant-survey.in
index 4bb4eaf..a5d5403 100644
--- a/taler-merchant-survey.in
+++ b/taler-merchant-survey.in
@@ -36,7 +36,6 @@ site.addsitedir("%s/lib/python%d.%d/site-packages" % (
## @cond
-TC = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
LOGGER = logging.getLogger(__name__)
# No perfect match to our logging format, but good enough ...
UWSGI_LOGFMT = "%(ltime) %(proto) %(method) %(uri) %(proto) => %(status)"
@@ -115,5 +114,6 @@ if getattr(ARGS, 'func', None) is None:
if ARGS.config is not None:
os.environ["TALER_CONFIG_FILE"] = ARGS.config
+TC = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
ARGS.func(ARGS)
diff --git a/talersurvey/talerconfig.py b/talersurvey/talerconfig.py
index 69d06a8..4a44c97 100644
--- a/talersurvey/talerconfig.py
+++ b/talersurvey/talerconfig.py
@@ -344,6 +344,7 @@ class TalerConfig:
filename = os.path.join(xdg, "taler.conf")
else:
filename = os.path.expanduser("~/.config/taler.conf")
+ print("Loading default config: (%s)" % filename)
if load_defaults:
cfg.load_defaults()
cfg.load_file(os.path.expanduser(filename))
@@ -496,7 +497,8 @@ class TalerConfig:
value=value, filename=filename,
lineno=lineno)
sections[current_section][key] = entry
except FileNotFoundError:
- LOGGER.error("Configuration file (%s) not found", filename)
+ # not logging here, as this interests the final user mostly.
+ print("Configuration file (%s) not found" % filename)
sys.exit(3)
##
--
To stop receiving notification emails like this one, please contact
address@hidden