[GRASS-SVN] r44807 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 30 07:09:31 EST 2010


Author: martinl
Date: 2010-12-30 04:09:31 -0800 (Thu, 30 Dec 2010)
New Revision: 44807

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/menuform: track suppress_required flags


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-30 12:03:23 UTC (rev 44806)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-12-30 12:09:31 UTC (rev 44807)
@@ -517,17 +517,20 @@
         """
         cmd = [self.name]
         
+        suppress_required = False
         for flag in self.flags:
             if flag['value']:
                 if len(flag['name']) > 1: # e.g. overwrite
                     cmd +=  [ '--' + flag['name'] ]
                 else:
                     cmd +=  [ '-' + flag['name'] ]
+                if flag['suppress_required']:
+                    suppress_required = True
         for p in self.params:
             if p.get('value','') ==  '' and p.get('required', False):
                 if p.get('default', '') !=  '':
                     cmd +=  [ '%s=%s' % (p['name'], p['default']) ]
-                elif ignoreErrors is False:
+                elif ignoreErrors is True and not suppress_required:
                     cmd +=  [ '%s=%s' % (p['name'], _('<required>')) ]
             elif p.get('value','') !=  '' and p['value'] !=  p.get('default','') :
                 # Output only values that have been set, and different from defaults



More information about the grass-commit mailing list