X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=devscripts%2Flazy_load_template.py;fp=devscripts%2Flazy_load_template.py;h=ae2bd27012ff27891f0757b88824bc7185d3e875;hb=779822d945dc7ebba7062ac9a5e760d21a7f362a;hp=0000000000000000000000000000000000000000;hpb=1b3d5e05a824f880f1171eb840235e13cd8848dc;p=youtube-dl diff --git a/devscripts/lazy_load_template.py b/devscripts/lazy_load_template.py new file mode 100644 index 000000000..ae2bd2701 --- /dev/null +++ b/devscripts/lazy_load_template.py @@ -0,0 +1,17 @@ +# flake8: noqa +from __future__ import unicode_literals + +import re + + +class LazyLoadExtractor(object): + _module = None + + @classmethod + def ie_key(cls): + return cls.__name__[:-2] + + def __new__(cls): + mod = __import__(cls._module, fromlist=(cls.__name__,)) + real_cls = getattr(mod, cls.__name__) + return real_cls.__new__(real_cls)