dabo Commit
Revision 3335
Date: 2007-08-26 06:51:02 -0700 (Sun, 26 Aug 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3335
Changed:
U trunk/dabo/db/dCursorMixin.py
U trunk/dabo/lib/datanav/Form.py
U trunk/dabo/lib/datanav/Page.py
U trunk/dabo/lib/datanav2/Form.py
U trunk/dabo/lib/datanav2/Page.py
U trunk/dabo/ui/__init__.py
U trunk/dabo/ui/uiwx/dEditor.py
U trunk/dabo/ui/uiwx/dForm.py
U trunk/dabo/ui/uiwx/dToggleButton.py
Log:
Running pygettext turned up lots of malformed localized strings. I've corrected
them all here.
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/db/dCursorMixin.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -1496,7 +1496,7 @@
if not fld:
raise dException.FieldNotFoundException, _("No field
specified for seek()")
if not self._records[0].has_key(fld) and not
self.VirtualFields.has_key(fld):
- raise dException.FieldNotFoundException,
_("Non-existent field '%s'" % fld)
+ raise dException.FieldNotFoundException,
_("Non-existent field '%s'") % fld
# Copy the specified field vals and their row numbers to a
list, and
# add those lists to the sort list
Modified: trunk/dabo/lib/datanav/Form.py
===================================================================
--- trunk/dabo/lib/datanav/Form.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/lib/datanav/Form.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -205,12 +205,12 @@
if self.FormType != "PickList":
for index in range(2, self.pageFrame.PageCount):
if index == 2:
- title = "&%s\tAlt+3" %
(_(self.pageFrame.Pages[index].Caption))
+ title = "&%s\tAlt+3" %
(self.pageFrame.Pages[index].Caption)
onHit = self.onEditCurrentRecord
tag =
self.pageFrame.Pages[index].DataSource
help = _("Edit the fields of the
currently selected record.")
else:
- title = "%s\tAlt+%d" %
(_(self.pageFrame.Pages[index].Caption), index + 1)
+ title = "%s\tAlt+%d" %
(self.pageFrame.Pages[index].Caption, index + 1)
onHit = onActivatePage
tag = self.pageFrame.Pages[index]
help = ""
@@ -353,7 +353,7 @@
def addEditPages(self, ds):
biz = self.getBizobj(ds)
if biz:
- title = _("Edit") + " " + _(biz.Caption)
+ title = _("Edit") + " " + biz.Caption
else:
title = _("Edit")
self.addEditPage(ds, title)
Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/lib/datanav/Page.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -217,8 +217,10 @@
def _orderByClause(self, infoOnly=False):
sf = self.sortFields
- if infoOnly: parts = lambda (k): (sf[k][2], _(sf[k][1]))
- else: parts = lambda (k): (k, sf[k][1].upper())
+ if infoOnly:
+ parts = lambda (k): (sf[k][2], sf[k][1])
+ else:
+ parts = lambda (k): (k, sf[k][1].upper())
flds = [(self.sortFields[k][0], k, " ".join(parts(k)))
for k in self.sortFields.keys()]
@@ -735,7 +737,7 @@
child = rs["target"]
childBiz = self.Form.getBizobj(child)
grdLabel =
self.addObject(dabo.ui.dLabel, "lblChild" + child)
- grdLabel.Caption =
_(self.Form.getBizobj(child).Caption)
+ grdLabel.Caption =
self.Form.getBizobj(child).Caption
grdLabel.FontSize = 14
grdLabel.FontBold = True
#mainSizer.append( (10, -1) )
Modified: trunk/dabo/lib/datanav2/Form.py
===================================================================
--- trunk/dabo/lib/datanav2/Form.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/lib/datanav2/Form.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -124,12 +124,12 @@
if self.FormType != "PickList":
for index in range(2, self.pageFrame.PageCount):
if index == 2:
- title = "&%s\tAlt+3" %
(_(self.pageFrame.Pages[index].Caption))
+ title = "&%s\tAlt+3" %
(self.pageFrame.Pages[index].Caption)
onHit = self.onEditCurrentRecord
tag =
self.pageFrame.Pages[index].DataSource
help = _("Edit the fields of the
currently selected record.")
else:
- title = "%s\tAlt+%d" %
(_(self.pageFrame.Pages[index].Caption), index + 1)
+ title = "%s\tAlt+%d" %
(self.pageFrame.Pages[index].Caption, index + 1)
onHit = onActivatePage
tag = self.pageFrame.Pages[index]
help = ""
@@ -272,7 +272,7 @@
"""Called when it is time to add the edit page(s)."""
biz = self.getBizobj()
if biz:
- caption = _("Edit") + " " + _(biz.Caption)
+ caption = _("Edit") + " " + biz.Caption
else:
caption = _("Edit")
self.addEditPage(ds, caption)
Modified: trunk/dabo/lib/datanav2/Page.py
===================================================================
--- trunk/dabo/lib/datanav2/Page.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/lib/datanav2/Page.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -213,8 +213,10 @@
def _orderByClause(self, infoOnly=False):
sf = self.sortFields
- if infoOnly: parts = lambda (k): (sf[k][2], _(sf[k][1]))
- else: parts = lambda (k): (k, sf[k][1].upper())
+ if infoOnly:
+ parts = lambda (k): (sf[k][2], sf[k][1])
+ else:
+ parts = lambda (k): (k, sf[k][1].upper())
flds = [(self.sortFields[k][0], k, " ".join(parts(k)))
for k in self.sortFields.keys()]
Modified: trunk/dabo/ui/__init__.py
===================================================================
--- trunk/dabo/ui/__init__.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/ui/__init__.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -9,26 +9,26 @@
would issue:
import dabo.ui
- dabo.ui.loadUI('wx')
+ dabo.ui.loadUI("wx")
"""
-import os, traceback
+import os
+import traceback
+import inspect
import dabo
from dabo.dLocalize import _
def getUIType():
- """ Return the identifier of the currently loaded UI, or None.
- """
+ """ Return the identifier of the currently loaded UI, or None."""
try:
- return uiType['shortName']
+ return uiType["shortName"]
except (AttributeError, NameError, KeyError):
return None
def loadUI(uiType):
- """ Load the given UI into the global namespace.
- """
+ """ Load the given UI into the global namespace."""
retVal = False
currType = getUIType()
mods = {"wx" : "dabo.ui.uiwx", "tk" : "dabo.ui.uitk"}
@@ -48,15 +48,13 @@
# Record the actual problem
#dabo.errorLog.write("Error Loading UI: %s" % e)
traceback.print_exc()
-
else:
if currType == typ:
# No problem; just a redundant call
pass
else:
- dabo.infoLog.write(_("Cannot change the uiType to '%s',
because UI '%s' is already loaded."
- % (typ, currType)))
-
+ dabo.infoLog.write(_("Cannot change the uiType to '%s',
because UI '%s' is already loaded.")
+ % (typ, currType))
return retVal
@@ -67,20 +65,19 @@
# everyone setting this environment variable. To specify the UI for your
# app, you should instead set the UI property of the dApp object.
try:
- __defaultUI = os.environ['DABO_DEFAULT_UI']
+ __defaultUI = os.environ["DABO_DEFAULT_UI"]
except KeyError:
__defaultUI = None
if __defaultUI:
- dabo.infoLog.write(_("Automatically loading default ui '%s'..." %
__defaultUI))
+ dabo.infoLog.write(_("Automatically loading default ui '%s'...") %
__defaultUI)
# For now, don't do the tempting option:
#loadUI(defaultUI)
# ...unless it will work with single-file installers. I think that
# for single-file installers, it needs to see the import statement.
# Therefore, do it explicitly:
- if __defaultUI in ('wx', 'wxPython', 'uiwx'):
+ if __defaultUI in ("wx", "wxPython", "uiwx"):
from uiwx import *
-
else:
pass
#dabo.infoLog.write(_("No default UI set. (DABO_DEFAULT_UI)"))
@@ -105,8 +102,6 @@
Caption = property(_getCaption, _setCaption, None, None)
DynamicCaption = makeDynamicProperty(Caption)
"""
- import inspect
-
propName = None
frame = inspect.currentframe(1)
for k, v in frame.f_locals.items():
@@ -134,7 +129,7 @@
update() method. The return value of the function will get set to the
%s property. If Dynamic%s is set to None (the default), %s
will not be dynamically evaluated.
-""" % (propName, propName, propName, propName))
+""") % (propName, propName, propName, propName)
if additionalDoc:
doc += "\n\n" + additionalDoc
Modified: trunk/dabo/ui/uiwx/dEditor.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditor.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/ui/uiwx/dEditor.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -1923,7 +1923,7 @@
if val.lower() in LexerDic.keys():
self._language = val.lower()
else:
- dabo.errorLog.write(_("Currently only
%s are supported" % ", ".join(LexerDic.keys())))
+ dabo.errorLog.write(_("Currently only
%s are supported") % ", ".join(LexerDic.keys()))
self.setDefaults()
self._defaultsSet = True
Modified: trunk/dabo/ui/uiwx/dForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dForm.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/ui/uiwx/dForm.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -358,7 +358,7 @@
except dException.BusinessRuleViolation, e:
self.setStatusText(_("Save failed."))
- msg = "%s:\n\n%s" % (_("Save Failed"), _( str(e) ))
+ msg = "%s:\n\n%s" % (_("Save Failed"), str(e))
self.notifyUser(msg, severe=True, exception=e)
return False
@@ -573,7 +573,7 @@
try:
bizobj.new()
except dException.dException, e:
- self.notifyUser(_("Add new record failed with
response:\n\n%s" % str(e)),
+ self.notifyUser(_("Add new record failed with
response:\n\n%s") % str(e),
severe=True, exception=e)
statusText = self.getCurrentRecordText(dataSource)
@@ -709,7 +709,7 @@
rowNumber = bizobj.RowNumber+1
else:
rowNumber = 1
- return _("Record %s/%s" % (rowNumber, rowCount))
+ return _("Record %s/%s") % (rowNumber, rowCount)
def validateField(self, ctrl):
Modified: trunk/dabo/ui/uiwx/dToggleButton.py
===================================================================
--- trunk/dabo/ui/uiwx/dToggleButton.py 2007-08-26 13:49:21 UTC (rev 3334)
+++ trunk/dabo/ui/uiwx/dToggleButton.py 2007-08-26 13:51:02 UTC (rev 3335)
@@ -116,7 +116,7 @@
state = ("down", "True")
else:
state = ("up", "False")
- self.Caption = _("State: %s (Boolean: %s)" % state)
+ self.Caption = _("State: %s (Boolean: %s)") % state
if __name__ == "__main__":
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]