This document describes Celery 2.4. For development docs, 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
.
-
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 torun()
.Parameters: - prog_name – The program name (
argv[0]
). - argv – Command arguments.
Exits with an error message if
supports_args
is disabled andargv
contains positional arguments.- prog_name – The program name (
-
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 0x7fb4e8993518: --app>, <Option at 0x7fb4e8993b48: -b/--broker>, <Option at 0x7fb4e8993908: --loader>, <Option at 0x7fb4e89937e8: --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.4.7'¶ Application version.
-
celery.bin.base.
daemon_options
(default_pidfile=None, default_logfile=None)¶