[GRASS-SVN] r32855 - grass/trunk/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 18 11:33:02 EDT 2008


Author: glynn
Date: 2008-08-18 11:33:02 -0400 (Mon, 18 Aug 2008)
New Revision: 32855

Modified:
   grass/trunk/lib/python/grass.py
Log:
Add exec_command


Modified: grass/trunk/lib/python/grass.py
===================================================================
--- grass/trunk/lib/python/grass.py	2008-08-18 13:38:03 UTC (rev 32854)
+++ grass/trunk/lib/python/grass.py	2008-08-18 15:33:02 UTC (rev 32855)
@@ -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