Package bitten :: Package build :: Module api :: Class CommandLine

Class CommandLine

object --+
         |
        CommandLine

Simple helper for executing subprocesses.
Instance Methods
 
__init__(self, executable, args, input=None, cwd=None, shell=False)
Initialize the CommandLine object.
 
execute(self, timeout=None)
Execute the command, and return a generator for iterating over the output written to the standard output and error streams.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, executable, args, input=None, cwd=None, shell=False)
(Constructor)

 
Initialize the CommandLine object.
Parameters:
  • executable - the name of the program to execute
  • args - a list of arguments to pass to the executable
  • input - string or file-like object containing any input data for the program
  • cwd - the working directory to change to before executing the command
Overrides: object.__init__

execute(self, timeout=None)

 
Execute the command, and return a generator for iterating over the output written to the standard output and error streams.
Parameters:
  • timeout - number of seconds before the external process should be aborted (not supported on Windows without subprocess module / Python 2.4+)