[GRASS-SVN] r48808 - in grass/branches/develbranch_6: gui/wxpython/gui_modules lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 14 15:06:31 EDT 2011


Author: martinl
Date: 2011-10-14 12:06:31 -0700 (Fri, 14 Oct 2011)
New Revision: 48808

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/lib/python/task.py
Log:
wxGUI: fully-qualified names only for input/map
       (merge r48807 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-10-14 19:06:01 UTC (rev 48807)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-10-14 19:06:31 UTC (rev 48808)
@@ -404,7 +404,7 @@
         errList = list()
         for action in self.GetItems(objType = ModelAction):
             task = menuform.GUI(show = None).ParseCommand(cmd = action.GetLog(string = False))
-            errList += task.getCmdError()
+            errList += task.get_cmdError()
         
         return errList
 
@@ -1797,7 +1797,7 @@
     def SetId(self, id):
         """!Set id"""
         self.id = id
-        cmd = self.task.getCmd(ignoreErrors = True)
+        cmd = self.task.get_cmd(ignoreErrors = True)
         if cmd and len(cmd) > 0:
             self.ClearText()
             self.AddText('(%d) %s' % (self.id, cmd[0]))
@@ -1816,7 +1816,7 @@
 
     def GetLog(self, string = True):
         """!Get logging info"""
-        cmd = self.task.getCmd(ignoreErrors = True, ignoreRequired = True)
+        cmd = self.task.get_cmd(ignoreErrors = True, ignoreRequired = True)
         
         # substitute variables
         variables = self.parent.GetVariables()
@@ -1856,7 +1856,7 @@
     
     def GetName(self):
         """!Get name"""
-        cmd = self.task.getCmd(ignoreErrors = True)
+        cmd = self.task.get_cmd(ignoreErrors = True)
         if cmd and len(cmd) > 0:
             return cmd[0]
         
@@ -3737,7 +3737,7 @@
         """!Check for errors, get list of messages"""
         errList = list()
         for task in self.tasks:
-            errList += task.getCmdError()
+            errList += task.get_cmd_error()
         
         return errList
     

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-10-14 19:06:01 UTC (rev 48807)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2011-10-14 19:06:31 UTC (rev 48808)
@@ -764,7 +764,7 @@
             self.SetItemText(layer, '%s %s' % (_('raster'), label))
         elif ltype == '3d-raster':
             self.SetItemImage(layer, self.rast3d_icon)
-            self.SetItemText(layer, '%s %s' % (_('3d raster'), label))
+            self.SetItemText(layer, '%s %s' % (_('3D raster'), label))
         elif ltype == 'rgb':
             self.SetItemImage(layer, self.rgb_icon)
             self.SetItemText(layer, '%s %s' % (_('RGB'), label))
@@ -773,7 +773,7 @@
             self.SetItemText(layer, '%s %s' % (_('HIS'), label))
         elif ltype == 'shaded':
             self.SetItemImage(layer, self.shaded_icon)
-            self.SetItemText(layer, '%s %s' % (_('Shaded relief'), label))
+            self.SetItemText(layer, '%s %s' % (_('shaded relief'), label))
         elif ltype == 'rastnum':
             self.SetItemImage(layer, self.rnum_icon)
             self.SetItemText(layer, '%s %s' % (_('raster cell numbers'), label))
@@ -827,7 +827,7 @@
                 ctrlId = ctrl.GetId()
             else:
                 ctrlId = None
-                
+            
             # add a data object to hold the layer's command (does not apply to generic command layers)
             self.SetPyData(layer, ({'cmd'      : cmd,
                                     'type'     : ltype,
@@ -889,7 +889,7 @@
         # updated progress bar range (mapwindow statusbar)
         if checked is True:
             self.mapdisplay.statusbarWin['progress'].SetRange(len(self.Map.GetListOfLayers(l_active = True)))
-            
+        
         return layer
 
     def PropertiesDialog (self, layer, show = True):

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-10-14 19:06:01 UTC (rev 48807)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-10-14 19:06:31 UTC (rev 48808)
@@ -427,7 +427,7 @@
         # status bar
         status_text = _("Enter parameters for '") + self.task.name + "'"
         try:
-            self.task.getCmd()
+            self.task.get_cmd()
             self.updateValuesHook()
         except ValueError:
             self.SetStatusText(status_text)
@@ -1633,7 +1633,7 @@
         for GRASS
         """
         try:
-            cmd = self.task.getCmd(ignoreErrors = ignoreErrors,
+            cmd = self.task.get_cmd(ignoreErrors = ignoreErrors,
                                    ignoreRequired = ignoreRequired)
         except ValueError, err:
             dlg = wx.MessageDialog(parent = self,
@@ -1948,7 +1948,7 @@
             task.get_flag('v')['value'] = True
             task.get_param('layer')['value'] = 1
             task.get_param('bcolor')['value'] = "red"
-            assert ' '.join(task.getCmd()) ==  "d.vect -v map = map_name layer = 1 bcolor = red"
+            assert ' '.join(task.get_cmd()) ==  "d.vect -v map = map_name layer = 1 bcolor = red"
         # Test interface building with handmade grassTask,
         # possibly outside of a GRASS session.
         task = gtask.grassTask()

Modified: grass/branches/develbranch_6/lib/python/task.py
===================================================================
--- grass/branches/develbranch_6/lib/python/task.py	2011-10-14 19:06:01 UTC (rev 48807)
+++ grass/branches/develbranch_6/lib/python/task.py	2011-10-14 19:06:31 UTC (rev 48808)
@@ -169,8 +169,8 @@
                 return f
         raise ValueError, _("Flag not found: %s") % aFlag
 
-    def getCmdError(self):
-        """!Get error string produced by getCmd(ignoreErrors = False)
+    def get_cmd_error(self):
+        """!Get error string produced by get_cmd(ignoreErrors = False)
         
         @return list of errors
         """
@@ -191,7 +191,7 @@
         
         return errorList
     
-    def getCmd(self, ignoreErrors = False, ignoreRequired = False):
+    def get_cmd(self, ignoreErrors = False, ignoreRequired = False):
         """!Produce an array of command name and arguments for feeding
         into some execve-like command processor.
 
@@ -221,7 +221,7 @@
                 # Output only values that have been set, and different from defaults
                 cmd +=  [ '%s=%s' % (p['name'], p['value']) ]
         
-        errList = self.getCmdError()
+        errList = self.get_cmd_error()
         if ignoreErrors is False and errList:
             raise ValueError, '\n'.join(errList)
         



More information about the grass-commit mailing list