__init__.py 950 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. """Utility functions.
  3. Don't import from here directly anymore, as these are only
  4. here for backwards compatibility.
  5. """
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. import sys
  8. from .functional import memoize # noqa
  9. from .nodenames import worker_direct, nodename, nodesplit
  10. __all__ = ['worker_direct', 'gen_task_name', 'nodename', 'nodesplit',
  11. 'cached_property', 'uuid']
  12. PY3 = sys.version_info[0] == 3
  13. # ------------------------------------------------------------------------ #
  14. # > XXX Compat
  15. from .log import LOG_LEVELS # noqa
  16. from .imports import ( # noqa
  17. qualname as get_full_cls_name, symbol_by_name as get_cls_by_name,
  18. instantiate, import_from_cwd, gen_task_name,
  19. )
  20. from .functional import chunks, noop # noqa
  21. from kombu.utils.objects import cached_property # noqa
  22. from kombu.utils.uuid import uuid # noqa
  23. gen_unique_id = uuid