__init__.py 908 B

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. """Distributed Task Queue"""
  3. # :copyright: (c) 2009 - 2011 by Ask Solem.
  4. # :license: BSD, see LICENSE for more details.
  5. from __future__ import absolute_import
  6. import os
  7. import sys
  8. VERSION = (2, 4, 4)
  9. __version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
  10. __author__ = "Ask Solem"
  11. __contact__ = "ask@celeryproject.org"
  12. __homepage__ = "http://celeryproject.org"
  13. __docformat__ = "restructuredtext"
  14. if sys.version_info < (2, 5):
  15. raise Exception(
  16. "Python 2.4 is not supported by this version. "
  17. "Please use Celery versions 2.1.x or earlier.")
  18. def Celery(*args, **kwargs):
  19. from .app import App
  20. return App(*args, **kwargs)
  21. if not os.environ.get("CELERY_NO_EVAL", False):
  22. from .local import Proxy
  23. def _get_current_app():
  24. from .app import current_app
  25. return current_app()
  26. current_app = Proxy(_get_current_app)