[GRASS-SVN] r39509 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 13 09:44:53 EDT 2009
Author: martinl
Date: 2009-10-13 09:44:52 -0400 (Tue, 13 Oct 2009)
New Revision: 39509
Modified:
grass/trunk/gui/wxpython/gui_modules/render.py
grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix CmdToTuple()
(merge r39507 & r39508 from devbr6)
Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py 2009-10-13 13:42:11 UTC (rev 39508)
+++ grass/trunk/gui/wxpython/gui_modules/render.py 2009-10-13 13:44:52 UTC (rev 39509)
@@ -1,4 +1,4 @@
-"""
+"""!
@package render
Rendering map layers and overlays into map composition image
@@ -9,15 +9,14 @@
- Overlay
- Map
-C) 2006-2008 by the GRASS Development Team
+(C) 2006-2009 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
- at author Michael Barton, Jachym Cepicky,
-Martin Landa <landa.martin gmail.com>
-
- at date 2006-2008
+ at author Michael Barton
+ at author Jachym Cepicky,
+ at author Martin Landa <landa.martin gmail.com>
"""
import os
Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py 2009-10-13 13:42:11 UTC (rev 39508)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py 2009-10-13 13:44:52 UTC (rev 39509)
@@ -424,10 +424,15 @@
if cmd[1].has_key('flags'):
for flag in cmd[1]['flags']:
scmd += ' -' + flag
+ for flag in ('verbose', 'quiet', 'overwrite'):
+ if cmd[1].has_key(flag) and cmd[1][flag] is True:
+ scmd += ' --' + flag
+
for k, v in cmd[1].iteritems():
- if k != 'flags':
- scmd += ' %s=%s' % (k, v)
-
+ if k in ('flags', 'verbose', 'quiet', 'overwrite'):
+ continue
+ scmd += ' %s=%s' % (k, v)
+
return scmd
def CmdToTuple(cmd):
@@ -437,9 +442,13 @@
dcmd = {}
for item in cmd[1:]:
- if '=' in item:
+ if '=' in item: # params
key, value = item.split('=', 1)
dcmd[str(key)] = str(value)
+ elif item[:2] == '--': # long flags
+ flag = item[2:]
+ if flag in ('verbose', 'quiet', 'overwrite'):
+ dcmd[str(flag)] = True
else: # -> flags
if not dcmd.has_key('flags'):
dcmd['flags'] = ''
More information about the grass-commit
mailing list