[GRASS-SVN] r46293 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat May 14 19:06:07 EDT 2011
Author: martinl
Date: 2011-05-14 16:06:07 -0700 (Sat, 14 May 2011)
New Revision: 46293
Modified:
grass/trunk/gui/wxpython/gui_modules/gcmd.py
Log:
wxGUI/RunCommand(): print debug message in more levels
Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py 2011-05-14 22:23:29 UTC (rev 46292)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py 2011-05-14 23:06:07 UTC (rev 46293)
@@ -584,9 +584,11 @@
@return returncode, stdout, messages (read == True and getErrorMsg == True)
@return stdout, stderr
"""
- Debug.msg(1, "gcmd.RunCommand(): %s" % ' '.join(grass.make_command(prog, flags, overwrite,
- quiet, verbose, **kwargs)))
+ cmdString = ' '.join(grass.make_command(prog, flags, overwrite,
+ quiet, verbose, **kwargs))
+ Debug.msg(1, "gcmd.RunCommand(): %s" % cmdString)
+
kwargs['stderr'] = subprocess.PIPE
if read:
@@ -597,24 +599,24 @@
ps = grass.start_command(prog, flags, overwrite, quiet, verbose, **kwargs)
- Debug.msg(1, "gcmd.RunCommand(): command started")
+ Debug.msg(2, "gcmd.RunCommand(): command started")
if stdin:
ps.stdin.write(stdin)
ps.stdin.close()
ps.stdin = None
- Debug.msg(1, "gcmd.RunCommand(): decoding string")
+ Debug.msg(3, "gcmd.RunCommand(): decoding string")
stdout, stderr = map(lambda x: utils.DecodeString(x) if type(x) is types.StringType else x, ps.communicate())
- Debug.msg(1, "gcmd.RunCommand(): get return code")
ret = ps.returncode
+ Debug.msg(1, "gcmd.RunCommand(): get return code %d" % ret)
- Debug.msg(1, "gcmd.RunCommand(): print error")
+ Debug.msg(3, "gcmd.RunCommand(): print error")
if ret != 0 and parent:
- Debug.msg(1, "gcmd.RunCommand(): error %s" % stderr)
+ Debug.msg(2, "gcmd.RunCommand(): error %s" % stderr)
if (stderr == None):
- Debug.msg(1, "gcmd.RunCommand(): nothing to print ???")
+ Debug.msg(2, "gcmd.RunCommand(): nothing to print ???")
else:
GError(parent = parent,
message = stderr)
@@ -622,7 +624,7 @@
if ret != 0:
return None
- Debug.msg(1, "gcmd.RunCommand(): print read error")
+ Debug.msg(3, "gcmd.RunCommand(): print read error")
if not read:
if not getErrorMsg:
return ret
@@ -630,15 +632,15 @@
return ret, _formatMsg(stderr)
if stdout:
- Debug.msg(1, "gcmd.RunCommand(): return stdout %s" % stdout)
+ Debug.msg(2, "gcmd.RunCommand(): return stdout\n'%s'" % stdout)
else:
- Debug.msg(1, "gcmd.RunCommand(): return stdout = None")
+ Debug.msg(2, "gcmd.RunCommand(): return stdout = None")
if not getErrorMsg:
return stdout
- Debug.msg(1, "gcmd.RunCommand(): return ret, stdout")
+ Debug.msg(2, "gcmd.RunCommand(): return ret, stdout")
if read and getErrorMsg:
return ret, stdout, _formatMsg(stderr)
- Debug.msg(1, "gcmd.RunCommand(): return result")
+ Debug.msg(2, "gcmd.RunCommand(): return result")
return stdout, _formatMsg(stderr)
More information about the grass-commit
mailing list