__init__.py 620 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. import sys
  3. try:
  4. from ._version import version as __version__
  5. except ImportError:
  6. __version__ = 'unknown'
  7. __all__ = ['easter', 'parser', 'relativedelta', 'rrule', 'tz',
  8. 'utils', 'zoneinfo']
  9. def __getattr__(name):
  10. import importlib
  11. if name in __all__:
  12. return importlib.import_module("." + name, __name__)
  13. raise AttributeError(
  14. "module {!r} has not attribute {!r}".format(__name__, name)
  15. )
  16. def __dir__():
  17. # __dir__ should include all the lazy-importable modules as well.
  18. return [x for x in globals() if x not in sys.modules] + __all__