aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-03-13 16:26:30 -0500
commit3201d77a148367d739862b4f07868a76eaeb7cb1 (patch)
tree78b8d71633ec000672a84ad0bbbddd0513ae2d30 /gallery_dl/postprocessor
parentfc83315c164afd74734adf27e0f7fec2011904aa (diff)
New upstream version 1.17.0.upstream/1.17.0
Diffstat (limited to 'gallery_dl/postprocessor')
-rw-r--r--gallery_dl/postprocessor/__init__.py14
-rw-r--r--gallery_dl/postprocessor/exec.py6
-rw-r--r--gallery_dl/postprocessor/metadata.py6
3 files changed, 8 insertions, 18 deletions
diff --git a/gallery_dl/postprocessor/__init__.py b/gallery_dl/postprocessor/__init__.py
index faa4d6c..ee490e7 100644
--- a/gallery_dl/postprocessor/__init__.py
+++ b/gallery_dl/postprocessor/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2018-2020 Mike Fährmann
+# Copyright 2018-2021 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -8,8 +8,6 @@
"""Post-processing modules"""
-import importlib
-
modules = [
"classify",
"compare",
@@ -28,16 +26,16 @@ def find(name):
except KeyError:
pass
- klass = None
+ cls = None
if name in modules: # prevent unwanted imports
try:
- module = importlib.import_module("." + name, __package__)
+ module = __import__(name, globals(), None, (), 1)
except ImportError:
pass
else:
- klass = module.__postprocessor__
- _cache[name] = klass
- return klass
+ cls = module.__postprocessor__
+ _cache[name] = cls
+ return cls
# --------------------------------------------------------------------
diff --git a/gallery_dl/postprocessor/exec.py b/gallery_dl/postprocessor/exec.py
index 5a54a77..2514219 100644
--- a/gallery_dl/postprocessor/exec.py
+++ b/gallery_dl/postprocessor/exec.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2018-2020 Mike Fährmann
+# Copyright 2018-2021 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -39,10 +39,6 @@ class ExecPP(PostProcessor):
events = options.get("event")
if events is None:
events = ("after",)
- if options.get("final"):
- self.log.warning("'final' is deprecated, "
- "use '\"event\": \"finalize\"' instead")
- events = ("finalize",)
elif isinstance(events, str):
events = events.split(",")
for event in events:
diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py
index c08f111..49696a0 100644
--- a/gallery_dl/postprocessor/metadata.py
+++ b/gallery_dl/postprocessor/metadata.py
@@ -39,7 +39,7 @@ class MetadataPP(PostProcessor):
if directory:
self._directory = self._directory_custom
sep = os.sep + (os.altsep or "")
- self._metadir = directory.rstrip(sep) + os.sep
+ self._metadir = util.expand_path(directory).rstrip(sep) + os.sep
filename = options.get("filename")
extfmt = options.get("extension-format")
@@ -55,10 +55,6 @@ class MetadataPP(PostProcessor):
events = options.get("event")
if events is None:
events = ("file",)
- if options.get("bypost"):
- self.log.warning("'bypost' is deprecated, use '\"event\": "
- "\"post\"' and 'filename' instead")
- events = ("metadata",)
elif isinstance(events, str):
events = events.split(",")
for event in events: