summaryrefslogtreecommitdiffstats
path: root/gallery_dl/config.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-09-28 18:27:46 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-09-28 18:27:46 -0400
commit9074eee175f76b824fbb6695d56426105191c51c (patch)
tree2294be463d325d7092e600d88f160027c437086d /gallery_dl/config.py
parent261c8c2bc74969e2242a153297895684742b6995 (diff)
New upstream version 1.15.0.upstream/1.15.0
Diffstat (limited to 'gallery_dl/config.py')
-rw-r--r--gallery_dl/config.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/gallery_dl/config.py b/gallery_dl/config.py
index a3c71cd..e0a5459 100644
--- a/gallery_dl/config.py
+++ b/gallery_dl/config.py
@@ -140,6 +140,25 @@ def interpolate_common(common, paths, key, default=None, *, conf=_config):
return default
+def accumulate(path, key, *, conf=_config):
+ """Accumulate the values of 'key' along 'path'"""
+ result = []
+ try:
+ if key in conf:
+ value = conf[key]
+ if value:
+ result.extend(value)
+ for p in path:
+ conf = conf[p]
+ if key in conf:
+ value = conf[key]
+ if value:
+ result[:0] = value
+ except Exception:
+ pass
+ return result
+
+
def set(path, key, value, *, conf=_config):
"""Set the value of property 'key' for this session"""
for p in path: