celery.bin.base

Click customizations for Celery.

class celery.bin.base.CLIContext(app, no_color, workdir, quiet=False)[исходный код]

Context Object for the CLI.

property ERROR
property OK
echo(message=None, **kwargs)[исходный код]
error(message=None, **kwargs)[исходный код]
pretty(n)[исходный код]
pretty_dict_ok_error(n)[исходный код]
pretty_list(n)[исходный код]
say_chat(direction, title, body='', show_body=False)[исходный код]
secho(message=None, **kwargs)[исходный код]
style(message=None, **kwargs)[исходный код]
class celery.bin.base.CeleryCommand(name: Optional[str], context_settings: Optional[Dict[str, Any]] = None, callback: Optional[Callable[[...], Any]] = None, params: Optional[List[Parameter]] = None, help: Optional[str] = None, epilog: Optional[str] = None, short_help: Optional[str] = None, options_metavar: Optional[str] = '[OPTIONS]', add_help_option: bool = True, no_args_is_help: bool = False, hidden: bool = False, deprecated: bool = False)[исходный код]

Customized command for Celery.

format_options(ctx, formatter)[исходный код]

Write all the options into the formatter if they exist.

class celery.bin.base.CeleryDaemonCommand(*args, **kwargs)[исходный код]

Daemon commands.

class celery.bin.base.CeleryOption(*args, **kwargs)[исходный код]

Customized option for Celery.

get_default(ctx, *args, **kwargs)[исходный код]

Get the default for the parameter. Tries Context.lookup_default() first, then the local default.

Параметры:
  • ctx – Current context.

  • call – If the default is a callable, call it. Disable to return the callable instead.

Изменено в версии 8.0.2: Type casting is no longer performed when getting a default.

Изменено в версии 8.0.1: Type casting can fail in resilient parsing mode. Invalid defaults will not prevent showing help text.

Изменено в версии 8.0: Looks at ctx.default_map first.

Изменено в версии 8.0: Added the call parameter.

class celery.bin.base.CommaSeparatedList[исходный код]

Comma separated list argument.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

name: str = 'comma separated list'

the descriptive name of this type

class celery.bin.base.ISO8601DateTime[исходный код]

ISO 8601 Date Time argument.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

name: str = 'iso-86091'

the descriptive name of this type

class celery.bin.base.ISO8601DateTimeOrFloat[исходный код]

ISO 8601 Date Time or float argument.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

name: str = 'iso-86091 or float'

the descriptive name of this type

class celery.bin.base.JsonArray[исходный код]

JSON formatted array argument.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

name: str = 'json array'

the descriptive name of this type

class celery.bin.base.JsonObject[исходный код]

JSON formatted object argument.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

name: str = 'json object'

the descriptive name of this type

class celery.bin.base.LogLevel[исходный код]

Log level option.

convert(value, param, ctx)[исходный код]

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 param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Параметры:
  • 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.

celery.bin.base.handle_preload_options(f)[исходный код]

Extract preload options and return a wrapped callable.

Вернуться на верх