app.utils

App utilities: Compat settings, bug-report tool, pickling apps.

Module Contents

Classes

Settings() Celery settings object.
AppPickler() Old application pickler/unpickler (< 3.1).

Functions

appstr(app) String used in __repr__ etc, to id app instances.
_new_key_to_old(key,convert=None)
_old_key_to_new(key,convert=None)
detect_settings(conf,preconf=dict,ignore_keys=set,prefix=None,all_keys=SETTING_KEYS,old_keys=_OLD_SETTING_KEYS)
_unpickle_app(cls,pickler,*args) Rebuild app for versions 2.5+.
_unpickle_app_v2(cls,kwargs) Rebuild app for versions 3.1+.
filter_hidden_settings(conf) Filter sensitive settings.
bugreport(app) Return a string containing information useful in bug-reports.
find_app(app,symbol_by_name=symbol_by_name,imp=import_from_cwd) Find app by name.
appstr(app)

String used in __repr__ etc, to id app instances.

class Settings

Celery settings object.

broker_read_url()
broker_write_url()
broker_url()
result_backend()
task_default_exchange()
task_default_routing_key()
timezone()
without_defaults()

Return the current configuration, but without defaults.

value_set_for(key)
find_option(name, namespace="")

Search for option by name.

Example:
>>> from proj.celery import app
>>> app.conf.find_option('disable_rate_limits')
('worker', 'prefetch_multiplier',
 <Option: type->bool default->False>))
Arguments:
name (str): Name of option, cannot be partial. namespace (str): Preferred name-space (None by default).
Returns:
Tuple: of (namespace, key, type).
find_value_for_key(name, namespace="celery")

Shortcut to get_by_parts(*find_option(name)[:-1]).

get_by_parts(*parts)

Return the current value for setting specified as a path.

Example:
>>> from proj.celery import app
>>> app.conf.get_by_parts('worker', 'disable_rate_limits')
False
finalize()
table(with_defaults=False, censored=True)
humanize(with_defaults=False, censored=True)

Return a human readable text showing configuration changes.

_new_key_to_old(key, convert=None)
_old_key_to_new(key, convert=None)
detect_settings(conf, preconf=dict, ignore_keys=set, prefix=None, all_keys=SETTING_KEYS, old_keys=_OLD_SETTING_KEYS)
class AppPickler

Old application pickler/unpickler (< 3.1).

__call__(cls, *args)
prepare(app, **kwargs)
build_kwargs(*args)
build_standard_kwargs(main, changes, loader, backend, amqp, events, log, control, accept_magic_kwargs, config_source=None)
construct(cls, **kwargs)
_unpickle_app(cls, pickler, *args)

Rebuild app for versions 2.5+.

_unpickle_app_v2(cls, kwargs)

Rebuild app for versions 3.1+.

filter_hidden_settings(conf)

Filter sensitive settings.

bugreport(app)

Return a string containing information useful in bug-reports.

find_app(app, symbol_by_name=symbol_by_name, imp=import_from_cwd)

Find app by name.