__init__.py 879 B

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