[GRASS-SVN] r44779 - in grass/branches/releasebranch_6_4/gui/wxpython: gui_modules xml

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 29 15:19:38 EST 2010


Author: martinl
Date: 2010-12-29 12:19:38 -0800 (Wed, 29 Dec 2010)
New Revision: 44779

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
   grass/branches/releasebranch_6_4/gui/wxpython/xml/menudata.xml
Log:
wxGUI: define first parameter for grassTask
(merge r44778 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-12-29 20:16:50 UTC (rev 44778)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-12-29 20:19:38 UTC (rev 44779)
@@ -356,14 +356,22 @@
         self.flags = list()
         self.keywords = list()
         self.errorMsg = ''
-
+        self.firstParam = None
+        
         if grassModule is not None:
             try:
                 processTask(tree = etree.fromstring(getInterfaceDescription(grassModule)),
                             task = self)
             except gcmd.GException, e:
                 self.errorMsg = str(e)
+                
+            self.define_first()
         
+    def define_first(self):
+        """!Define first parameter"""
+        if len(self.params) > 0:
+            self.firstParam = self.params[0]['name']
+        
     def get_error_msg(self):
         """!Get error message ('' for no error)"""
         return self.errorMsg
@@ -535,7 +543,8 @@
         self.__processModule()
         self.__processParams()
         self.__processFlags()
-
+        self.task.define_first()
+        
     def __processModule(self):
         """!Process module description"""
         self.task.name = self.root.get('name', default = 'unknown')
@@ -2058,11 +2067,11 @@
                     try:
                         key, value = option.split('=', 1)
                     except:
-                        if i ==  0: # add key name of first parameter if not given
+                        if i == 0: # add key name of first parameter if not given
                             key = self.grass_task.get_options()['params'][0]['name']
                             value = option
                         else:
-                            raise gcmd.GException, _("Unable to parse command %s") % ' '.join(cmd)
+                            raise gcmd.GException, _("Unable to parse command '%s'") % ' '.join(cmd)
                     
                     element = self.grass_task.get_param(key, raiseError = False)
                     if not element:

Modified: grass/branches/releasebranch_6_4/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/xml/menudata.xml	2010-12-29 20:16:50 UTC (rev 44778)
+++ grass/branches/releasebranch_6_4/gui/wxpython/xml/menudata.xml	2010-12-29 20:19:38 UTC (rev 44779)
@@ -2933,7 +2933,7 @@
 	  <help>Display the HTML man pages of GRASS</help>
 	  <keywords>general,manual,help</keywords>
 	  <handler>RunMenuCmd</handler>
-	  <command>g.manual wxGUI</command>
+	  <command>g.manual entry=wxGUI</command>
 	</menuitem>
 	<separator />
 	<menuitem>



More information about the grass-commit mailing list