code adjustments according to pep8 nr2

This commit is contained in:
Mike Fährmann
2017-02-01 00:53:19 +01:00
parent f1b7d41608
commit 94e10f249a
68 changed files with 390 additions and 167 deletions

View File

@@ -8,7 +8,6 @@
import re
import importlib
from .. import config
modules = [
"pixiv",
@@ -75,6 +74,7 @@ modules = [
"test",
]
def find(url):
"""Find suitable extractor for the given url"""
for pattern, klass in _list_patterns():
@@ -83,6 +83,7 @@ def find(url):
return klass(match)
return None
def extractors():
"""Yield all available extractor classes"""
return sorted(
@@ -90,12 +91,14 @@ def extractors():
key=lambda x: x.__name__
)
# --------------------------------------------------------------------
# internals
_cache = []
_module_iter = iter(modules)
def _list_patterns():
"""Yield all available (pattern, class) tuples"""
yield from _cache
@@ -110,6 +113,7 @@ def _list_patterns():
_cache.extend(tuples)
yield from tuples
def _get_classes(module):
"""Return a list of all extractor classes in a module"""
return [