I am a class that handles a command for a program. Commands can be
nested underneath a command for further processing.
|
__init__(self,
parentCommand=None,
stdout=None,
stderr=None,
width=None)
Create a new command instance, with the given parent. |
source code
|
|
|
addOptions(self)
Override me to add options to the parser. |
source code
|
|
int
|
do(self,
args)
Override me to implement the functionality of the command. |
source code
|
|
int
|
|
|
handleOptions(self,
options)
Handle the parsed options. |
source code
|
|
|
outputHelp(self,
file=None)
Output help information. |
source code
|
|
|
|
|
getRootCommand(self)
Return the top-level command, which is typically the program. |
source code
|
|
|
debug(self,
format,
*args)
Override me to handle debug output from this class. |
source code
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
|
name = None
name of the command, lowercase; defaults to the lowercase version of
the class name
|
list of str
|
aliases = None
list of alternative lowercase names recognized
|
|
usage = None
short one-line usage string; %command gets expanded to a sub-command
or [commands] as appropriate.
|
|
summary = None
short one-line summary of the command
|
|
description = None
longer paragraph explaining the command
|
|
parentCommand = None
hash(x)
|
dict of str -> Command
|
subCommands = None
dict of name -> commands below this command
|
|
subCommandClasses = None
hash(x)
|
|
aliasedSubCommands = None
hash(x)
|
optparse.OptionParser
|
parser = None
the option parser used for parsing
|