From 46d811bac0ca9b43a4d9b261fb4f81bb3d4e4a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 18 Nov 2022 17:15:32 +0100 Subject: [PATCH] add loaded config files to debug output --- gallery_dl/__init__.py | 2 ++ gallery_dl/config.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 79ecbccc..3701d6fd 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -138,6 +138,8 @@ def main(): except AttributeError: pass + log.debug("Configuration Files %s", config._files) + if args.list_modules: extractor.modules.append("") sys.stdout.write("\n".join(extractor.modules)) diff --git a/gallery_dl/config.py b/gallery_dl/config.py index 953b1b1c..0f2d1f19 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -21,6 +21,7 @@ log = logging.getLogger("config") # internals _config = {} +_files = [] if util.WINDOWS: _default_configs = [ @@ -61,8 +62,8 @@ def load(files=None, strict=False, fmt="json"): else: parsefunc = json.load - for path in files or _default_configs: - path = util.expand_path(path) + for pathfmt in files or _default_configs: + path = util.expand_path(pathfmt) try: with open(path, encoding="utf-8") as file: confdict = parsefunc(file) @@ -79,6 +80,7 @@ def load(files=None, strict=False, fmt="json"): _config.update(confdict) else: util.combine_dict(_config, confdict) + _files.append(pathfmt) def clear():