2
0

lazy_load_template.py 367 B

1234567891011121314151617
  1. # flake8: noqa
  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):
  10. mod = __import__(cls._module, fromlist=(cls.__name__,))
  11. real_cls = getattr(mod, cls.__name__)
  12. return real_cls.__new__(real_cls)