[GRASS-SVN] r29994 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 7 05:22:54 EST 2008
Author: martinl
Date: 2008-02-07 05:22:54 -0500 (Thu, 07 Feb 2008)
New Revision: 29994
Modified:
grass/trunk/gui/wxpython/gui_modules/gcmd.py
Log:
wxGUI: add some new examples how to use gcmd module
Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py 2008-02-07 10:08:11 UTC (rev 29993)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py 2008-02-07 10:22:54 UTC (rev 29994)
@@ -498,7 +498,7 @@
# d.rast verbosely, wait for process termination
print "Running d.rast..."
- cmd = Command(cmd=["d.rast", "elevation.dem"], verbose=True, wait=True, rerr=True)
+ cmd = Command(cmd=["d.rast", "elevation.dem"], verbose=3, wait=True, rerr=True)
if cmd.returncode == None:
print "RUNNING"
@@ -514,7 +514,7 @@
cmd = Command(cmd=["v.net.path", "in=roads at PERMANENT", "out=tmp", "dmax=100000", "--o"],
stdin="0 593527.6875 4925297.0625 602083.875 4917545.8125",
- verbose=False,
+ verbose=0,
wait=True, rerr=None)
if cmd.returncode == None:
@@ -530,7 +530,7 @@
# returncode will be None
print "Running d.vect tmp..."
- cmd = Command(["d.vect", "tmp"], verbose=False, wait=False, rerr=None)
+ cmd = Command(["d.vect", "tmp"], verbose=2, wait=False, rerr=None)
if cmd.returncode == None:
print "RUNNING"
@@ -538,3 +538,16 @@
print "SUCCESS"
else:
print "FAILURE (%d)" % cmd.returncode
+
+ cmd = Command(["g.region", "-p"])
+
+ for line in cmd.ReadStdOutput():
+ print line
+
+ cmd = Command(["g.region", "-p"], stderr=None)
+
+ for line in cmd.ReadStdOutput():
+ print line
+ for line in cmd.ReadErrOutput():
+ print line
+
More information about the grass-commit
mailing list