[postprocessor] initial code
This commit is contained in:
32
gallery_dl/postprocessor/__init__.py
Normal file
32
gallery_dl/postprocessor/__init__.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2018 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
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
log = logging.getLogger("postprocessor")
|
||||
|
||||
|
||||
def find(name):
|
||||
"""Return a postprocessor class with the given name"""
|
||||
try:
|
||||
return _cache[name]
|
||||
except KeyError:
|
||||
try:
|
||||
module = importlib.import_module("."+name, __package__)
|
||||
cls = module.__postprocessor__
|
||||
_cache[name] = cls
|
||||
return cls
|
||||
except (ImportError, AttributeError):
|
||||
return None
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# internals
|
||||
|
||||
_cache = {}
|
||||
15
gallery_dl/postprocessor/common.py
Normal file
15
gallery_dl/postprocessor/common.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2018 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
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
"""Common classes and constants used by postprocessor modules."""
|
||||
|
||||
|
||||
class PostProcessor():
|
||||
|
||||
def run(self, asd):
|
||||
raise NotImplementedError()
|
||||
Reference in New Issue
Block a user