You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
456 B

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. class LazyLoadExtractor(object):
  5. _module = None
  6. @classmethod
  7. def ie_key(cls):
  8. return cls.__name__[:-2]
  9. def __new__(cls, *args, **kwargs):
  10. mod = __import__(cls._module, fromlist=(cls.__name__,))
  11. real_cls = getattr(mod, cls.__name__)
  12. instance = real_cls.__new__(real_cls)
  13. instance.__init__(*args, **kwargs)
  14. return instance