This document describes an older version of Celery (2.5). For the latest stable version please go here.

celery.bin.base

class celery.bin.base.Command(app=None, get_app=None)

Base class for command line applications.

Parameters:
  • app – The current app.
  • get_app – Callable returning the current app if no app provided.
Parser

alias of OptionParser

args = ''

Arg list used in help.

create_parser(prog_name)
enable_config_from_cmdline = False

Enable if the application should support config from the cmdline.

execute_from_commandline(argv=None)

Execute application from command line.

Parameters:argv – The list of command line arguments. Defaults to sys.argv.
expanduser(value)
get_cls_by_name(name)
get_options()

Get supported command line options.

handle_argv(prog_name, argv)

Parses command line arguments from argv and dispatches to run().

Parameters:
  • prog_name – The program name (argv[0]).
  • argv – Command arguments.

Exits with an error message if supports_args is disabled and argv contains positional arguments.

namespace = 'celery'

Default configuration namespace.

option_list = ()

List of options (without preload options).

parse_options(prog_name, arguments)

Parse the available options.

parse_preload_options(args)
preload_options = (<Option at 0x73feb90: --app>, <Option at 0x73fe998: -b/--broker>, <Option at 0x73fea28: --loader>, <Option at 0x73fefc8: --config>)

List of options to parse before parsing other options.

prepare_preload_options(options)

Optional handler to do additional processing of preload options.

Configuration must not have been initialized until after this is called.

process_cmdline_config(argv)
run(*args, **options)

This is the body of the command called by handle_argv().

setup_app_from_commandline(argv)
supports_args = True

If false the parser will raise an exception if positional args are provided.

usage()

Returns the command-line usage string for this app.

version = '2.5.5'

Application version.

celery.bin.base.daemon_options(default_pidfile=None, default_logfile=None)

Previous topic

celery.apps.beat

Next topic

celery.bin.celeryd

This Page