This document describes Celery 3.0. For development docs,
go here.
celery.bin.base
These options are supported by all commands,
and usually parsed before command-specific arguments.
-
-A, --app
app instance to use (e.g. module.attr_name)
-
-b, --broker
url to broker. default is ‘amqp://guest@localhost//’
-
--loader
name of custom loader class to use.
-
--config
Name of the configuration module
These options are supported by commands that can detach
into the background (daemon). They will be present
in any command that also has a –detach option.
-
-f, --logfile
Path to log file. If no logfile is specified, stderr is used.
-
--pidfile
Optional file used to store the process pid.
The program will not start if this file already exists
and the pid is still alive.
-
--uid
User id, or user name of the user to run as after detaching.
-
--gid
Group id, or group name of the main group to change to after
detaching.
-
--umask
Effective umask of the process after detaching. Default is 0.
-
--workdir
Optional directory to change to after detaching.
-
class celery.bin.base.Command(app=None, get_app=None)[source]
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.
-
check_args(args)[source]
-
create_parser(prog_name, command=None)[source]
-
description = ''
Text to print in –help before option list.
-
die(msg, status=1)[source]
-
doc = None
-
early_version(argv)[source]
-
enable_config_from_cmdline = False
Enable if the application should support config from the cmdline.
-
epilog = None
Text to print at end of –help
-
execute_from_commandline(argv=None)[source]
Execute application from command line.
| Parameters: | argv – The list of command line arguments.
Defaults to sys.argv. |
-
expanduser(value)[source]
-
find_app(app)[source]
-
get_cls_by_name(name)
-
get_options()[source]
Get supported command line options.
-
handle_argv(prog_name, argv)[source]
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.
-
leaf = True
Set to true if this command doesn’t have subcommands
-
maybe_patch_concurrency(argv=None)[source]
-
namespace = 'celery'
Default configuration namespace.
-
on_concurrency_setup()[source]
-
option_list = ()
List of options (without preload options).
-
parse_doc(doc)[source]
-
parse_options(prog_name, arguments)[source]
Parse the available options.
-
parse_preload_options(args)[source]
-
preload_options = (<Option at 0x89b3440: -A/--app>, <Option at 0x89c4b90: -b/--broker>, <Option at 0x89c4290: --loader>, <Option at 0x89c4cf8: --config>, <Option at 0x89c43b0: --workdir>)
List of options to parse before parsing other options.
-
prepare_args(options, args)[source]
-
prepare_parser(parser)[source]
-
process_cmdline_config(argv)[source]
-
respects_app_option = True
-
run(*args, **options)[source]
This is the body of the command called by handle_argv().
-
run_from_argv(prog_name, argv=None)[source]
-
setup_app_from_commandline(argv)[source]
-
supports_args = True
If false the parser will raise an exception if positional
args are provided.
-
symbol_by_name(name)[source]
-
usage(command)[source]
Returns the command line usage string for this app.
-
version = '3.0.19 (Chiastic Slide)'
Application version.
-
with_pool_option(argv)[source]
Returns tuple of (short_opts, long_opts) if the command
supports a pool argument, and used to monkey patch eventlet/gevent
environments as early as possible.
- E.g::
- has_pool_option = ([‘-P’], [‘–pool’])
-
class celery.bin.base.HelpFormatter(indent_increment=2, max_help_position=24, width=None, short_first=1)[source]
-
format_description(description)[source]
-
format_epilog(epilog)[source]
-
celery.bin.base.daemon_options(default_pidfile=None, default_logfile=None)[source]