summaryrefslogtreecommitdiffstats
path: root/gallery_dl/config.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-06-01 23:11:37 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-06-01 23:11:37 -0400
commita70a3246927b72f1ded37acd55ee719515441b5b (patch)
tree57f0d3ab0b1387b665325f42a24b8aab63cbce07 /gallery_dl/config.py
parent90e50db2e3c38f523bb5195d295290b06e5cedb0 (diff)
New upstream version 1.14.0.upstream/1.14.0
Diffstat (limited to 'gallery_dl/config.py')
-rw-r--r--gallery_dl/config.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gallery_dl/config.py b/gallery_dl/config.py
index c2787ad..5303616 100644
--- a/gallery_dl/config.py
+++ b/gallery_dl/config.py
@@ -22,8 +22,9 @@ log = logging.getLogger("config")
_config = {}
-if os.name == "nt":
+if util.WINDOWS:
_default_configs = [
+ r"%APPDATA%\gallery-dl\config.json",
r"%USERPROFILE%\gallery-dl\config.json",
r"%USERPROFILE%\gallery-dl.conf",
]
@@ -139,7 +140,6 @@ def unset(path, key, *, conf=_config):
class apply():
"""Context Manager: apply a collection of key-value pairs"""
- _sentinel = object()
def __init__(self, kvlist):
self.original = []
@@ -147,12 +147,12 @@ class apply():
def __enter__(self):
for path, key, value in self.kvlist:
- self.original.append((path, key, get(path, key, self._sentinel)))
+ self.original.append((path, key, get(path, key, util.SENTINEL)))
set(path, key, value)
def __exit__(self, etype, value, traceback):
for path, key, value in self.original:
- if value is self._sentinel:
+ if value is util.SENTINEL:
unset(path, key)
else:
set(path, key, value)