diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-23 00:49:23 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-23 01:04:29 +0530 |
commit | 3fb4e21b38063d22b421e45b9bb24f707654c111 (patch) | |
tree | 30f24043b778949cd3d1825b44b23db8a6cb4583 /devscripts | |
parent | 4dfbf8696b0c614eee480b44a86959b9a055fb97 (diff) | |
download | hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.tar.lz hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.tar.xz hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.zip |
[lazy_extractors] Fix `suitable` and add flake8 test
Diffstat (limited to 'devscripts')
-rw-r--r-- | devscripts/lazy_load_template.py | 4 | ||||
-rw-r--r-- | devscripts/make_lazy_extractors.py | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/devscripts/lazy_load_template.py b/devscripts/lazy_load_template.py index d06655d10..20322e04b 100644 --- a/devscripts/lazy_load_template.py +++ b/devscripts/lazy_load_template.py @@ -8,10 +8,6 @@ import re class LazyLoadExtractor(object): _module = None - @classmethod - def ie_key(cls): - return cls.__name__[:-2] - def __new__(cls, *args, **kwargs): mod = __import__(cls._module, fromlist=(cls.__name__,)) real_cls = getattr(mod, cls.__name__) diff --git a/devscripts/make_lazy_extractors.py b/devscripts/make_lazy_extractors.py index 727d28204..8189c77dc 100644 --- a/devscripts/make_lazy_extractors.py +++ b/devscripts/make_lazy_extractors.py @@ -32,6 +32,7 @@ with open('devscripts/lazy_load_template.py', 'rt') as f: module_contents = [ module_template, + getsource(InfoExtractor.ie_key), getsource(InfoExtractor._match_valid_url), getsource(InfoExtractor.suitable), '\nclass LazyLoadSearchExtractor(LazyLoadExtractor):\n pass\n'] @@ -104,7 +105,7 @@ for ie in ordered_cls: names.append(name) module_contents.append( - '_ALL_CLASSES = [{0}]'.format(', '.join(names))) + '\n_ALL_CLASSES = [{0}]'.format(', '.join(names))) module_src = '\n'.join(module_contents) + '\n' |