This document is for Celery's development version, which can be significantly different from previous releases. Get old docs here: 2.5.

celery.utils

celery.utils

Utility functions.

copyright:
  1. 2009 - 2012 by Ask Solem.
license:

BSD, see LICENSE for more details.

celery.utils.cry()

Return stacktrace of all active threads.

From https://gist.github.com/737056

celery.utils.deprecated(description=None, deprecation=None, removal=None, alternative=None)
celery.utils.fun_takes_kwargs(fun, kwlist=[])

With a function, and a list of keyword arguments, returns arguments in the list which the function takes.

If the object has an argspec attribute that is used instead of using the inspect.getargspec() introspection.

Parameters:
  • fun – The function to inspect arguments of.
  • kwlist – The list of keyword arguments.

Examples

>>> def foo(self, x, y, logfile=None, loglevel=None):
...     return x * y
>>> fun_takes_kwargs(foo, ["logfile", "loglevel", "task_id"])
["logfile", "loglevel"]
>>> def foo(self, x, y, **kwargs):
>>> fun_takes_kwargs(foo, ["logfile", "loglevel", "task_id"])
["logfile", "loglevel", "task_id"]
celery.utils.is_iterable(obj)
celery.utils.isatty(fh)
celery.utils.lpmerge(L, R)

In place left precedent dictionary merge.

Keeps values from L, if the value in R is None.

celery.utils.maybe_reraise()

Reraise if an exception is currently being handled, or return otherwise.

celery.utils.warn_deprecated(description=None, deprecation=None, removal=None, alternative=None)

Previous topic

celery.backends.database.session

Next topic

celery.utils.functional

This Page