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=sys.stdout,
stderr=sys.stdout)
Create a new command instance, with the given parent. |
source code
|
|
|
addOptions(self)
Override me to add options to the parser. |
source code
|
|
|
do(self,
args)
Override me to implement the functionality of the command. |
source code
|
|
int
|
|
|
handleOptions(self,
options)
Handle the parsed options. |
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
|
|
|
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
|