]>
Commit | Line | Data |
---|---|---|
cc52de43 | 1 | #!/usr/bin/env python3 |
dcdb292f | 2 | # coding: utf-8 |
779822d9 JMF |
3 | from __future__ import unicode_literals |
4 | ||
5 | import re | |
6 | ||
7 | ||
8 | class LazyLoadExtractor(object): | |
9 | _module = None | |
10 | ||
11 | @classmethod | |
12 | def ie_key(cls): | |
13 | return cls.__name__[:-2] | |
14 | ||
8a5dc1c1 | 15 | def __new__(cls, *args, **kwargs): |
779822d9 JMF |
16 | mod = __import__(cls._module, fromlist=(cls.__name__,)) |
17 | real_cls = getattr(mod, cls.__name__) | |
8a5dc1c1 JMF |
18 | instance = real_cls.__new__(real_cls) |
19 | instance.__init__(*args, **kwargs) | |
20 | return instance |