1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +01:00

remove 'info' parameter

This commit is contained in:
Mike Fährmann 2015-11-21 03:12:36 +01:00
parent 78234f0572
commit 2d498b19a1
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -47,7 +47,7 @@ modules = [
def find(url):
"""Find extractor suitable for handling the given url"""
for pattern, info, klass in _list_patterns():
for pattern, klass in _list_patterns():
match = re.match(pattern, url)
if match:
return klass(match)
@ -66,19 +66,11 @@ def _list_patterns():
for module_name in _module_iter:
module = importlib.import_module("."+module_name, __package__)
try:
klass = getattr(module, module.info["extractor"])
userpatterns = config.get(("extractor", module_name, "pattern"), default=[])
for pattern in userpatterns + module.info["pattern"]:
etuple = (pattern, module.info, klass)
for klass in _get_classes(module):
for pattern in klass.pattern:
etuple = (pattern, klass)
_cache.append(etuple)
yield etuple
except AttributeError:
for klass in _get_classes(module):
for pattern in klass.pattern:
etuple = (pattern, klass.info, klass)
_cache.append(etuple)
yield etuple
def _get_classes(module):
"""Return a list of all extractor classes in a module"""