[GRASS-SVN] r59352 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 26 04:01:09 PDT 2014


Author: martinl
Date: 2014-03-26 04:01:09 -0700 (Wed, 26 Mar 2014)
New Revision: 59352

Modified:
   grass/trunk/lib/python/script/core.py
Log:
winGRASS: fig debug() to handle '&' on Windows, check debug_level

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2014-03-26 10:56:08 UTC (rev 59351)
+++ grass/trunk/lib/python/script/core.py	2014-03-26 11:01:09 UTC (rev 59352)
@@ -510,9 +510,12 @@
     @param msg debugging message to be displayed
     @param debug debug level (0-5)
     """
-    run_command("g.message", flags='d', message=msg, debug=debug)
+    if debug_level() >= debug:
+        if sys.platform == "win32":
+            msg = msg.replace('&', '^&')
+            
+        run_command("g.message", flags='d', message=msg, debug=debug)
 
-
 def verbose(msg):
     """!Display a verbose message using `g.message -v`
 



More information about the grass-commit mailing list