This document describes the current stable version of Celery (5.6). For development docs, go here.
celery.bin.base¶
Click customizations for Celery.
- class celery.bin.base.CLIContext(app, no_color, workdir, quiet=False)[source]¶
Context Object for the CLI.
- property ERROR¶
- property OK¶
- class celery.bin.base.CeleryCommand(name: str | None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[[...], Any] | None = None, params: list[Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool | str = False)[source]¶
Customized command for Celery.
- class celery.bin.base.CeleryOption(*args, **kwargs)[source]¶
Customized option for Celery.
- get_default(ctx, *args, **kwargs)[source]¶
Return the default value for this option.
Several auto-derived defaults are resolved lazily here rather than eagerly in
__init__(). This keepsdefaultraw at construction time, soself.default is UNSETreliably answers “did the user pass a default?” for feature-switch-group arbitration and for anything else that needs to distinguish “absent” from a chosen value. The resolution rules live in_resolve_lazy_default().Changed in version 8.5.0:
UNSETdefaults for boolean and multi flags are now resolved here instead of being coerced in__init__(). Readingdefaultdirectly returns the user-supplied value (orUNSETif none was passed) rather than the auto-derived one.Changed in version 8.3.3:
default=Trueis no longer substituted withflag_valuefor boolean flags, fixing negative boolean flags likeflag_value=False, default=True.
- class celery.bin.base.CommaSeparatedList[source]¶
Comma separated list argument.
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None.ctx – The current context that arrived at this value. May be
None.
- class celery.bin.base.ISO8601DateTime[source]¶
ISO 8601 Date Time argument.
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None.ctx – The current context that arrived at this value. May be
None.
- class celery.bin.base.ISO8601DateTimeOrFloat[source]¶
ISO 8601 Date Time or float argument.
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None.ctx – The current context that arrived at this value. May be
None.
- class celery.bin.base.JsonArray[source]¶
JSON formatted array argument.
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None.ctx – The current context that arrived at this value. May be
None.
- class celery.bin.base.JsonObject[source]¶
JSON formatted object argument.
- convert(value, param, ctx)[source]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None.ctx – The current context that arrived at this value. May be
None.