[GRASS-SVN] r48806 - in grass/trunk: gui/wxpython/gui_modules
lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Oct 14 14:58:11 EDT 2011
Author: martinl
Date: 2011-10-14 11:58:11 -0700 (Fri, 14 Oct 2011)
New Revision: 48806
Modified:
grass/trunk/gui/wxpython/gui_modules/gmodeler.py
grass/trunk/gui/wxpython/gui_modules/layertree.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
grass/trunk/lib/python/task.py
Log:
pythonlib: rename getCmd -> get_cmd (follow naming convetion)
Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2011-10-14 17:55:05 UTC (rev 48805)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2011-10-14 18:58:11 UTC (rev 48806)
@@ -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
@@ -1791,7 +1791,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]))
@@ -1810,7 +1810,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()
@@ -1850,7 +1850,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]
@@ -3731,7 +3731,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/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-10-14 17:55:05 UTC (rev 48805)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-10-14 18:58:11 UTC (rev 48806)
@@ -806,7 +806,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))
@@ -815,7 +815,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))
@@ -869,7 +869,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,
@@ -934,7 +934,7 @@
# updated progress bar range (mapwindow statusbar)
if checked:
self.mapdisplay.GetProgressBar().SetRange(len(self.Map.GetListOfLayers(l_active = True)))
-
+
return layer
def PropertiesDialog (self, layer, show = True):
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-10-14 17:55:05 UTC (rev 48805)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2011-10-14 18:58:11 UTC (rev 48806)
@@ -471,7 +471,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)
@@ -1814,7 +1814,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,
@@ -2138,7 +2138,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/trunk/lib/python/task.py
===================================================================
--- grass/trunk/lib/python/task.py 2011-10-14 17:55:05 UTC (rev 48805)
+++ grass/trunk/lib/python/task.py 2011-10-14 18:58:11 UTC (rev 48806)
@@ -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