Package svnmailer :: Module processes :: Class Process
[show private | hide private]
[frames | no frames]

Class Process

object --+
         |
        Process


Spawn a child with certain attributes
Method Summary
  __init__(self, cmd, pstdin, pstdout, pstderr, detach)
Initialization
Process detach(cls, command)
Returns the process object of a detached process (Class method)
Process pipe2(cls, command)
Returns the process object of a piped process (Class method)
Process pipe4(cls, command)
Returns the process object of a piped process (Class method)
int wait(self)
Waits for the process to end
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Instance Variable Summary
file fromchild: pipe from the child
file tochild: pipe to the child

Class Variable Summary
str IMPLEMENTATION: A token describing the chosen implementation.

Instance Method Details

__init__(self, cmd, pstdin=False, pstdout=False, pstderr=False, detach=False)
(Constructor)

Initialization
Parameters:
cmd - The command to execute (type must be suitable for the platform)
           (type=list or basestring)
pstdin - Pipe to stdin?
           (type=bool)
pstdout - Pipe from stdout?
           (type=bool)
pstderr - Pipe from stderr (on stdout channel)
           (type=bool)
detach - Detach the process? (evauluated on Win32 only)
           (type=bool)
Raises:
NotImplementedError - not implemented functions were activated
Overrides:
__builtin__.object.__init__

wait(self)

Waits for the process to end
Returns:
The exit status of the process
           (type=int)

Note: The implementation may define a dummy wait call. The actual waiting happens when the last pipe handle is closed then. This happens if the dumb implementation is used.


Class Method Details

detach(cls, command)

Returns the process object of a detached process

The function spawns a command detached from the current one. All std-handles are inherited (no pipe is opened).

Parameters:
command - The command list (the first item is the command itself, the rest represents the arguments)
           (type=list)
Returns:
The process object
           (type=Process)
Raises:
NotImplementedError - Detaching this way is not implemented on this platform

pipe2(cls, command)

Returns the process object of a piped process

The function spawns a command and opens two pipes. One pipe is for writing to command's stdin and the other one is for reading stdout. stderr is inherited from the caller.

Parameters:
command - The command list (the first item is the command itself, the rest represents the arguments)
           (type=list)
Returns:
The process object
           (type=Process)

pipe4(cls, command)

Returns the process object of a piped process

The function spawns a command and opens two pipes. One pipe is for writing to command's stdin and the other one is for reading stdout + stderr (together)

Parameters:
command - The command list (the first item is the command itself, the rest represents the arguments)
           (type=list)
Returns:
The process object
           (type=Process)

Instance Variable Details

fromchild

pipe from the child
Type:
file

tochild

pipe to the child
Type:
file

Class Variable Details

IMPLEMENTATION

A token describing the chosen implementation. Possible tokens are: subprocess, popen, win32api, dumb
Type:
str
Value:
'popen'                                                                

Generated by Epydoc 2.0 on Sun Sep 25 20:49:05 2005 http://epydoc.sf.net