Package flumotion :: Package extern :: Package command :: Module command
[hide private]

Module command

source code

Command class.

Classes [hide private]
  CommandHelpFormatter
I format the description as usual, but add an overview of commands after it if there are any, formatted like the options.
  CommandOptionParser
I parse options as usual, but I explicitly allow setting stdout so that our print_help() method (invoked by default with -h/--help) defaults to writing there.
  Command
I am a class that handles a command for a program.
  CommandExited
  CommandOk
  CommandError
Functions [hide private]
 
commandToCmd(command)
Take a Command instance and create a cmd.Cmd class from it that implements a command line interpreter.
source code
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

commandToCmd(command)

source code 

Take a Command instance and create a cmd.Cmd class from it that implements a command line interpreter.

Example use in a command:

>>> def do(self, args):
...     cmd = command.commandToCmd(self)
...     cmd.prompt = 'prompt> '
...     while not cmd.exited:
...         cmd.cmdloop()