[GRASS-SVN] r50515 - in grass/trunk/gui/wxpython: gmodeler gui_core
iclass modules psmap vdigit wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 28 05:26:07 EST 2012
Author: martinl
Date: 2012-01-28 02:26:06 -0800 (Sat, 28 Jan 2012)
New Revision: 50515
Modified:
grass/trunk/gui/wxpython/gmodeler/model.py
grass/trunk/gui/wxpython/gui_core/goutput.py
grass/trunk/gui/wxpython/iclass/frame.py
grass/trunk/gui/wxpython/modules/colorrules.py
grass/trunk/gui/wxpython/psmap/dialogs.py
grass/trunk/gui/wxpython/vdigit/toolbars.py
grass/trunk/gui/wxpython/wxplot/base.py
grass/trunk/gui/wxpython/wxplot/histogram.py
grass/trunk/gui/wxpython/wxplot/scatter.py
Log:
wxGUI: fix gettext warning
Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/gmodeler/model.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -385,7 +385,7 @@
report = False
break
if report:
- errList.append(_("%s: undefined variable '%s'") % (cmd[0], var))
+ errList.append(cmd[0] + ": " + _("undefined variable '%s'") % var)
### TODO: check variables in file only optionally
### errList += self._substituteFile(action, checkOnly = True)
@@ -447,7 +447,7 @@
if sval:
var = sval.group(2).strip()[1:] # ignore '%'
cmd = item.GetLog(string = False)[0]
- errList.append(_("%s: undefined variable '%s'") % (cmd, var))
+ errList.append(cmd + ": " + _("undefined variable '%s'") % var)
if not checkOnly:
if write:
Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -763,35 +763,30 @@
"""!Command done (or aborted)"""
if self.parent.GetName() == 'Modeler':
self.parent.OnCmdDone(event)
+
+ # Process results here
+ try:
+ ctime = time.time() - event.time
+ if ctime < 60:
+ stime = _("%d sec") % int(ctime)
+ else:
+ mtime = int(ctime / 60)
+ stime = _("%(min)d min %(sec)d sec") % { 'min' : mtime,
+ 'sec' : int(ctime - (mtime * 60)) }
+ except KeyError:
+ # stopped deamon
+ stime = _("unknown")
if event.aborted:
# Thread aborted (using our convention of None return)
self.WriteLog(_('Please note that the data are left in inconsistent state '
'and may be corrupted'), self.cmdOutput.StyleWarning)
- self.WriteCmdLog('(%s) %s (%d sec)' % (str(time.ctime()),
- _('Command aborted'),
- (time.time() - event.time)))
- # pid=self.cmdThread.requestId)
- self.btnCmdAbort.Enable(False)
+ msg = _('Command aborted')
else:
- try:
- # Process results here
- ctime = time.time() - event.time
- if ctime < 60:
- stime = _("%d sec") % int(ctime)
- else:
- mtime = int(ctime / 60)
- stime = _("%d min %d sec") % (mtime,
- int(ctime - (mtime * 60)))
-
- self.WriteCmdLog('(%s) %s (%s)' % (str(time.ctime()),
- _('Command finished'),
- (stime)))
- except KeyError:
- # stopped deamon
- pass
-
- self.btnCmdAbort.Enable(False)
+ msg = _('Command finished')
+
+ self.WriteCmdLog('(%s) %s (%s)' % (str(time.ctime()), msg, stime))
+ self.btnCmdAbort.Enable(False)
if event.onDone:
event.onDone(cmd = event.cmd, returncode = event.returncode)
Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/iclass/frame.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -665,8 +665,10 @@
nLayers = len(groupLayers)
if nLayers <= 1:
GMessage(parent = self,
- message = _("Group <%s> does not have enough files "
- "(it has %d files). Operation canceled.") % (group, nLayers))
+ message = _("Group <%(group)s> does not have enough files "
+ "(it has %(files)d files). Operation canceled.") % \
+ { 'group' : group,
+ 'files' : nLayers })
return False
#check if vector has any areas
Modified: grass/trunk/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/modules/colorrules.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/modules/colorrules.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -1172,9 +1172,10 @@
if not self.CheckMapset():
# v.colors doesn't need the map to be in current mapset
if not (self.version7 and self.attributeType == 'color'):
- message = _("Selected map <%s> is not in current mapset <%s>. "
+ message = _("Selected map <%(map)s> is not in current mapset <%(mapset)s>. "
"Attribute table cannot be edited.") % \
- (self.inmap, grass.gisenv()['MAPSET'])
+ { 'map' : self.inmap,
+ 'mapset' : grass.gisenv()['MAPSET'] }
wx.CallAfter(GMessage, parent = self, message = message)
self.DisableClearAll()
return
@@ -1451,9 +1452,11 @@
range = ''
if self.properties['min'] or self.properties['max']:
if ctype == float:
- range = _("(range: %.1f to %.1f)") % (self.properties['min'], self.properties['max'])
+ range = "%s: %.1f - %.1f)" % (_("range"),
+ self.properties['min'], self.properties['max'])
elif ctype == int:
- range = _("(range: %d to %d)") % (self.properties['min'], self.properties['max'])
+ range = "%s: %d - %d)" % (_("range"),
+ self.properties['min'], self.properties['max'])
if range:
if self.colorTable:
self.cr_label.SetLabel(_("Enter vector attribute values or percents %s:") % range)
Modified: grass/trunk/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/dialogs.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/psmap/dialogs.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -1106,7 +1106,9 @@
GError(_("Failed to read instruction %s") % instruction)
return False
if not os.path.exists(instr['epsfile']):
- GError(_("Failed to read instruction %s: file %s not found.") % instruction, instr['epsfile'])
+ GError(_("Failed to read instruction %(inst)s: "
+ "file %(file)s not found.") % { 'inst' : instruction,
+ 'file' : instr['epsfile'] })
return False
instr['epsfile'] = os.path.abspath(instr['epsfile'])
@@ -6013,7 +6015,9 @@
def SetSizeInfoLabel(self, image):
"""!Update image size label"""
- self.imagePanel.image['sizeInfo'].SetLabel(_("size: %s x %s pts") % (image.GetWidth(), image.GetHeight()))
+ self.imagePanel.image['sizeInfo'].SetLabel(_("size: %(width)s x %(height)s pts") % \
+ { 'width' : image.GetWidth(),
+ 'height' : image.GetHeight() })
self.imagePanel.image['sizeInfo'].GetContainingSizer().Layout()
def ClearPreview(self):
Modified: grass/trunk/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/toolbars.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/vdigit/toolbars.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -764,8 +764,9 @@
self.EnableTool(tool, False)
elif fType:
GError(parent = self,
- message = _("Unsupported feature type '%s'. Unable to edit "
- "OGR layer <%s>.") % (fType, mapLayer.GetName()))
+ message = _("Unsupported feature type '%(type)s'. Unable to edit "
+ "OGR layer <%(layer)s>.") % { 'type' : fType,
+ 'layer' : mapLayer.GetName() })
self.digit.CloseMap()
self.mapLayer = None
self.StopEditing()
Modified: grass/trunk/gui/wxpython/wxplot/base.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/base.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/wxplot/base.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -396,8 +396,8 @@
self.client.SaveFile()
def OnMouseLeftDown(self,event):
- self.SetStatusText(_("Left Mouse Down at Point: (%.4f, %.4f)") % \
- self.client._getXY(event))
+ self.SetStatusText(_("Left Mouse Down at Point:") + \
+ " (%.4f, %.4f)" % self.client._getXY(event))
event.Skip() # allows plotCanvas OnMouseLeftDown to be called
def OnMotion(self, event):
Modified: grass/trunk/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/histogram.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/wxplot/histogram.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -214,12 +214,11 @@
message = []
title = _('Statistics for Map(s) Histogrammed')
- for r in self.rasterList:
- rast = r.split('@')[0]
+ for rast in self.rasterList:
ret = grass.read_command('r.univar', map = r, flags = 'e', quiet = True)
- stats = _('Statistics for %s\n\n%s\n') % (rast, ret)
+ stats = _('Statistics for raster map <%s>') % rast + ':\n%s\n' % ret
message.append(stats)
-
+
stats = PlotStatsFrame(self, id = wx.ID_ANY, message = message,
title = title)
Modified: grass/trunk/gui/wxpython/wxplot/scatter.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/scatter.py 2012-01-28 10:07:06 UTC (rev 50514)
+++ grass/trunk/gui/wxpython/wxplot/scatter.py 2012-01-28 10:26:06 UTC (rev 50515)
@@ -253,12 +253,14 @@
map2 = rast2,
flags = 'g', quiet = True,
parse = (grass.parse_key_val, { 'sep' : '=' }))
- eqtitle = _('Regression equation for %s vs. %s:\n\n') % (rast1, rast2)
- eq = _(' %s = %s + %s(%s)\n\n') % (rast2, ret['a'], ret['b'], rast1)
- num = _('N = %s\n') % ret['N']
- rval = _('R = %s\n') % ret['R']
- rsq = _('R-squared = %f\n') % pow(float(ret['R']), 2)
- ftest = _('F = %s\n') % ret['F']
+ eqtitle = _('Regression equation for raster map <%(rast1)s> vs. <%(rast2)s>:\n\n') % \
+ { 'rast1' : rast1,
+ 'rast2' : rast2 }
+ eq = ' %s = %s + %s(%s)\n\n' % (rast2, ret['a'], ret['b'], rast1)
+ num = 'N = %s\n' % ret['N']
+ rval = 'R = %s\n' % ret['R']
+ rsq = 'R-squared = %f\n' % pow(float(ret['R']), 2)
+ ftest = 'F = %s\n' % ret['F']
str = eqtitle + eq + num + rval + rsq + ftest
message.append(str)
More information about the grass-commit
mailing list