GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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.

1 cmd = Command(cmd=['d.rast', 'elevation.dem'], verbose=3, wait=True)
2 
3 if cmd.returncode == None:
4  print 'RUNNING?'
5 elif cmd.returncode == 0:
6  print 'SUCCESS'
7 else:
8  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 305 of file gcmd.py.

Constructor & Destructor Documentation

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

Definition at line 335 of file gcmd.py.

Field Documentation

gcmd.Command.cmdThread

Definition at line 358 of file gcmd.py.

gcmd.Command.returncode

Definition at line 366 of file gcmd.py.

gcmd.Command.stderr

Definition at line 338 of file gcmd.py.


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