__init__.py 891 B

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