[GRASS-SVN] r52151 - in grass/branches/develbranch_6: gui/wxpython/gui_core lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 20 00:58:28 PDT 2012
Author: annakrat
Date: 2012-06-20 00:58:28 -0700 (Wed, 20 Jun 2012)
New Revision: 52151
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py
grass/branches/develbranch_6/lib/python/db.py
Log:
wxGUI: fix gettext warnings (merge from trunk, r52149)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py 2012-06-20 07:58:15 UTC (rev 52150)
+++ grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py 2012-06-20 07:58:28 UTC (rev 52151)
@@ -477,13 +477,14 @@
# update history file
env = grass.gisenv()
try:
- fileHistory = codecs.open(os.path.join(env['GISDBASE'],
- env['LOCATION_NAME'],
- env['MAPSET'],
- '.bash_history'),
- encoding = 'utf-8', mode = 'a')
+ filePath = os.path.join(env['GISDBASE'],
+ env['LOCATION_NAME'],
+ env['MAPSET'],
+ '.bash_history')
+ fileHistory = codecs.open(filePath, encoding = 'utf-8', mode = 'a')
except IOError, e:
- GError(_("Unable to write file '%s'.\n\nDetails: %s") % (path, e),
+ GError(_("Unable to write file '%(filePath)s'.\n\nDetails: %(error)s") %
+ {filePath: filePath, error : e },
parent = self.parent)
fileHistory = None
@@ -653,7 +654,8 @@
dlg = wx.FileDialog(self, message = _("Save file as..."),
defaultFile = "grass_cmd_output.txt",
- wildcard = _("%s (*.txt)|*.txt|%s (*)|*") % (_("Text files"), _("Files")),
+ wildcard = _("%(txt)s (*.txt)|*.txt|%(files)s (*)|*") %
+ {txt: _("Text files"), files: _("Files")},
style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
# Show the dialog and retrieve the user response. If it is the OK response,
@@ -665,7 +667,7 @@
output = open(path, "w")
output.write(text)
except IOError, e:
- GError(_("Unable to write file '%s'.\n\nDetails: %s") % (path, e))
+ GError(_("Unable to write file '%(path)s'.\n\nDetails: %(error)s") % {path: path, error: e})
finally:
output.close()
self.parent.SetStatusText(_("Commands output saved into '%s'") % path)
@@ -778,7 +780,8 @@
if len(cmds) > 0:
output.write('\n')
except IOError, e:
- GError(_("Unable to write file '%s'.\n\nDetails: %s") % (path, e))
+ GError(_("Unable to write file '%(filePath)s'.\n\nDetails: %(error)s") %
+ {filePath: self.cmdFileProtocol, error: e})
finally:
output.close()
@@ -797,7 +800,8 @@
# ask for the file
dlg = wx.FileDialog(self, message = _("Save file as..."),
defaultFile = "grass_cmd_protocol.txt",
- wildcard = _("%s (*.txt)|*.txt|%s (*)|*") % (_("Text files"), _("Files")),
+ wildcard = _("%(txt)s (*.txt)|*.txt|%(files)s (*)|*") %
+ {txt: _("Text files"), files: _("Files")},
style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
self.cmdFileProtocol = dlg.GetPath()
Modified: grass/branches/develbranch_6/lib/python/db.py
===================================================================
--- grass/branches/develbranch_6/lib/python/db.py 2012-06-20 07:58:15 UTC (rev 52150)
+++ grass/branches/develbranch_6/lib/python/db.py 2012-06-20 07:58:28 UTC (rev 52151)
@@ -123,8 +123,8 @@
elif table:
args['table'] = table
else:
- fatal(_("Programmer error: '%s', '%s', or '%s' must be provided") %
- 'sql', 'filename', 'table')
+ fatal(_("Programmer error: '%(sql)s', '%(filename)s', or '%(table)s' must be provided") %
+ {sql: 'sql', filename: 'filename', table: 'table'} )
if 'fs' not in args:
args['fs'] = '|'
More information about the grass-commit
mailing list