This document describes cell 0.0. For development docs, go here.
cell.bin.base¶
cell.bin.base
-
class
cell.bin.base.
Option
(*opts, **attrs)¶ - Instance attributes:
_short_opts : [string] _long_opts : [string]
action : string type : string dest : string default : any nargs : int const : any choices : [string] callback : function callback_args : (any*) callback_kwargs : { string : any } help : string metavar : string
-
ACTIONS
= ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', 'callback', 'help', 'version')¶
-
ALWAYS_TYPED_ACTIONS
= ('store', 'append')¶
-
ATTRS
= ['action', 'type', 'dest', 'default', 'nargs', 'const', 'choices', 'callback', 'callback_args', 'callback_kwargs', 'help', 'metavar']¶
-
CHECK_METHODS
= [<function _check_action at 0x7fabce730050>, <function _check_type at 0x7fabce7300c8>, <function _check_choice at 0x7fabce730140>, <function _check_dest at 0x7fabce7301b8>, <function _check_const at 0x7fabce730230>, <function _check_nargs at 0x7fabce7302a8>, <function _check_callback at 0x7fabce730320>]¶
-
CONST_ACTIONS
= ('store_const', 'append_const')¶
-
STORE_ACTIONS
= ('store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count')¶
-
TYPED_ACTIONS
= ('store', 'append', 'callback')¶
-
TYPES
= ('string', 'int', 'long', 'float', 'complex', 'choice')¶
-
TYPE_CHECKER
= {'int': <function check_builtin at 0x7fabce72bc80>, 'float': <function check_builtin at 0x7fabce72bc80>, 'complex': <function check_builtin at 0x7fabce72bc80>, 'long': <function check_builtin at 0x7fabce72bc80>, 'choice': <function check_choice at 0x7fabce72bcf8>}¶
-
check_value
(opt, value)¶
-
convert_value
(opt, value)¶
-
get_opt_string
()¶
-
process
(opt, value, values, parser)¶
-
take_action
(action, dest, opt, value, values, parser)¶
-
takes_value
()¶
-
class
cell.bin.base.
Command
¶ -
Parser
¶ alias of
OptionParser
-
args
= ''¶
-
create_parser
(prog_name)¶
-
execute_from_commandline
(argv=None)¶ Execute application from command line.
Parameters: argv – The list of command line arguments. Defaults to sys.argv
.
-
exit
(v=0)¶
-
exit_status
(msg, status=0, fh=<open file '<stderr>', mode 'w'>)¶
-
exit_usage
(msg)¶
-
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.
- prog_name – The program name (
-
option_list
= ()¶
-
parse_options
(prog_name, arguments)¶ Parse the available options.
-
prog_name
= None¶
-
run
(*args, **options)¶
-
usage
()¶ Returns the command-line usage string for this app.
-
version
= '0.0.3'¶
-