[GRASS-SVN] r32856 - grass/branches/develbranch_6/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 18 11:57:30 EDT 2008


Author: martinl
Date: 2008-08-18 11:57:30 -0400 (Mon, 18 Aug 2008)
New Revision: 32856

Modified:
   grass/branches/develbranch_6/lib/python/grass.py
Log:
glynn: Add exec_command (merge from trunk, r32855)


Modified: grass/branches/develbranch_6/lib/python/grass.py
===================================================================
--- grass/branches/develbranch_6/lib/python/grass.py	2008-08-18 15:33:02 UTC (rev 32855)
+++ grass/branches/develbranch_6/lib/python/grass.py	2008-08-18 15:57:30 UTC (rev 32856)
@@ -58,6 +58,12 @@
     ps = pipe_command(*args, **kwargs)
     return ps.communicate()[0]
 
+def exec_command(prog, flags = "", overwrite = False, quiet = False, verbose = False, env = None, **kwargs):
+    args = make_command(prog, flags, overwrite, quiet, verbose, **kwargs)
+    if env == None:
+	env = os.environ
+    os.execvpe(prog, args, env)
+
 # interface to g.message
 
 def message(msg, flag = None):



More information about the grass-commit mailing list