GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_modules.gcmd.Command Class Reference

Run command in separate thread. More...

Public Member Functions

def __init__

Data Fields

 cmd
 stderr
 cmdThread
 returncode

Detailed Description

Run command in separate thread.

Used for commands launched on the background.

If stdout/err is redirected, write() method is required for the given classes.

cmd = Command(cmd=['d.rast', 'elevation.dem'], verbose=3, wait=True)
if cmd.returncode == None:
print 'RUNNING?'
elif cmd.returncode == 0:
print 'SUCCESS'
else:
print 'FAILURE (%d)' % cmd.returncode
Parameters:
cmdcommand given as list
stdinstandard input stream
verboseverbose level [0, 3] (–q, –v)
waitwait for child execution terminated
rerrerror handling (when CmdError raised). True for redirection to stderr, False for GUI dialog, None for no operation (quiet mode)
stdoutredirect standard output or None
stderrredirect standard error output or None

Definition at line 271 of file gcmd.py.


Constructor & Destructor Documentation

def gui_modules.gcmd.Command.__init__ (   self,
  cmd,
  stdin = None,
  verbose = None,
  wait = True,
  rerr = False,
  stdout = None,
  stderr = None 
)

Definition at line 301 of file gcmd.py.


Field Documentation

gui_modules.gcmd.Command.cmdThread

Definition at line 324 of file gcmd.py.

gui_modules.gcmd.Command.returncode

Definition at line 332 of file gcmd.py.

gui_modules.gcmd.Command.stderr

Definition at line 304 of file gcmd.py.


The documentation for this class was generated from the following file: