Changeset 3335
- Timestamp:
- 08/26/07 06:51:02 (1 year ago)
- Files:
-
- trunk/dabo/db/dCursorMixin.py (modified) (1 diff)
- trunk/dabo/lib/datanav/Form.py (modified) (2 diffs)
- trunk/dabo/lib/datanav/Page.py (modified) (2 diffs)
- trunk/dabo/lib/datanav2/Form.py (modified) (2 diffs)
- trunk/dabo/lib/datanav2/Page.py (modified) (1 diff)
- trunk/dabo/ui/__init__.py (modified) (9 diffs)
- trunk/dabo/ui/uiwx/dEditor.py (modified) (1 diff)
- trunk/dabo/ui/uiwx/dForm.py (modified) (3 diffs)
- trunk/dabo/ui/uiwx/dToggleButton.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/db/dCursorMixin.py
r3327 r3335 1497 1497 raise dException.FieldNotFoundException, _("No field specified for seek()") 1498 1498 if not self._records[0].has_key(fld) and not self.VirtualFields.has_key(fld): 1499 raise dException.FieldNotFoundException, _("Non-existent field '%s'" % fld)1499 raise dException.FieldNotFoundException, _("Non-existent field '%s'") % fld 1500 1500 1501 1501 # Copy the specified field vals and their row numbers to a list, and trunk/dabo/lib/datanav/Form.py
r3303 r3335 206 206 for index in range(2, self.pageFrame.PageCount): 207 207 if index == 2: 208 title = "&%s\tAlt+3" % ( _(self.pageFrame.Pages[index].Caption))208 title = "&%s\tAlt+3" % (self.pageFrame.Pages[index].Caption) 209 209 onHit = self.onEditCurrentRecord 210 210 tag = self.pageFrame.Pages[index].DataSource 211 211 help = _("Edit the fields of the currently selected record.") 212 212 else: 213 title = "%s\tAlt+%d" % ( _(self.pageFrame.Pages[index].Caption), index + 1)213 title = "%s\tAlt+%d" % (self.pageFrame.Pages[index].Caption, index + 1) 214 214 onHit = onActivatePage 215 215 tag = self.pageFrame.Pages[index] … … 354 354 biz = self.getBizobj(ds) 355 355 if biz: 356 title = _("Edit") + " " + _(biz.Caption)356 title = _("Edit") + " " + biz.Caption 357 357 else: 358 358 title = _("Edit") trunk/dabo/lib/datanav/Page.py
r3303 r3335 218 218 def _orderByClause(self, infoOnly=False): 219 219 sf = self.sortFields 220 if infoOnly: parts = lambda (k): (sf[k][2], _(sf[k][1])) 221 else: parts = lambda (k): (k, sf[k][1].upper()) 220 if infoOnly: 221 parts = lambda (k): (sf[k][2], sf[k][1]) 222 else: 223 parts = lambda (k): (k, sf[k][1].upper()) 222 224 223 225 flds = [(self.sortFields[k][0], k, " ".join(parts(k))) … … 736 738 childBiz = self.Form.getBizobj(child) 737 739 grdLabel = self.addObject(dabo.ui.dLabel, "lblChild" + child) 738 grdLabel.Caption = _(self.Form.getBizobj(child).Caption)740 grdLabel.Caption = self.Form.getBizobj(child).Caption 739 741 grdLabel.FontSize = 14 740 742 grdLabel.FontBold = True trunk/dabo/lib/datanav2/Form.py
r3303 r3335 125 125 for index in range(2, self.pageFrame.PageCount): 126 126 if index == 2: 127 title = "&%s\tAlt+3" % ( _(self.pageFrame.Pages[index].Caption))127 title = "&%s\tAlt+3" % (self.pageFrame.Pages[index].Caption) 128 128 onHit = self.onEditCurrentRecord 129 129 tag = self.pageFrame.Pages[index].DataSource 130 130 help = _("Edit the fields of the currently selected record.") 131 131 else: 132 title = "%s\tAlt+%d" % ( _(self.pageFrame.Pages[index].Caption), index + 1)132 title = "%s\tAlt+%d" % (self.pageFrame.Pages[index].Caption, index + 1) 133 133 onHit = onActivatePage 134 134 tag = self.pageFrame.Pages[index] … … 273 273 biz = self.getBizobj() 274 274 if biz: 275 caption = _("Edit") + " " + _(biz.Caption)275 caption = _("Edit") + " " + biz.Caption 276 276 else: 277 277 caption = _("Edit") trunk/dabo/lib/datanav2/Page.py
r3303 r3335 214 214 def _orderByClause(self, infoOnly=False): 215 215 sf = self.sortFields 216 if infoOnly: parts = lambda (k): (sf[k][2], _(sf[k][1])) 217 else: parts = lambda (k): (k, sf[k][1].upper()) 216 if infoOnly: 217 parts = lambda (k): (sf[k][2], sf[k][1]) 218 else: 219 parts = lambda (k): (k, sf[k][1].upper()) 218 220 219 221 flds = [(self.sortFields[k][0], k, " ".join(parts(k))) trunk/dabo/ui/__init__.py
r3303 r3335 10 10 11 11 import dabo.ui 12 dabo.ui.loadUI( 'wx')12 dabo.ui.loadUI("wx") 13 13 14 14 """ 15 import os, traceback 15 import os 16 import traceback 17 import inspect 16 18 import dabo 17 19 from dabo.dLocalize import _ … … 19 21 20 22 def getUIType(): 21 """ Return the identifier of the currently loaded UI, or None. 22 """ 23 """ Return the identifier of the currently loaded UI, or None.""" 23 24 try: 24 return uiType[ 'shortName']25 return uiType["shortName"] 25 26 except (AttributeError, NameError, KeyError): 26 27 return None … … 28 29 29 30 def loadUI(uiType): 30 """ Load the given UI into the global namespace. 31 """ 31 """ Load the given UI into the global namespace.""" 32 32 retVal = False 33 33 currType = getUIType() … … 49 49 #dabo.errorLog.write("Error Loading UI: %s" % e) 50 50 traceback.print_exc() 51 52 51 else: 53 52 if currType == typ: … … 55 54 pass 56 55 else: 57 dabo.infoLog.write(_("Cannot change the uiType to '%s', because UI '%s' is already loaded." 58 % (typ, currType))) 59 56 dabo.infoLog.write(_("Cannot change the uiType to '%s', because UI '%s' is already loaded.") 57 % (typ, currType)) 60 58 return retVal 61 59 … … 68 66 # app, you should instead set the UI property of the dApp object. 69 67 try: 70 __defaultUI = os.environ[ 'DABO_DEFAULT_UI']68 __defaultUI = os.environ["DABO_DEFAULT_UI"] 71 69 except KeyError: 72 70 __defaultUI = None 73 71 74 72 if __defaultUI: 75 dabo.infoLog.write(_("Automatically loading default ui '%s'..." % __defaultUI))73 dabo.infoLog.write(_("Automatically loading default ui '%s'...") % __defaultUI) 76 74 # For now, don't do the tempting option: 77 75 #loadUI(defaultUI) … … 79 77 # for single-file installers, it needs to see the import statement. 80 78 # Therefore, do it explicitly: 81 if __defaultUI in ( 'wx', 'wxPython', 'uiwx'):79 if __defaultUI in ("wx", "wxPython", "uiwx"): 82 80 from uiwx import * 83 84 81 else: 85 82 pass … … 106 103 DynamicCaption = makeDynamicProperty(Caption) 107 104 """ 108 import inspect109 110 105 propName = None 111 106 frame = inspect.currentframe(1) … … 135 130 %s property. If Dynamic%s is set to None (the default), %s 136 131 will not be dynamically evaluated. 137 """ % (propName, propName, propName, propName))132 """) % (propName, propName, propName, propName) 138 133 139 134 if additionalDoc: trunk/dabo/ui/uiwx/dEditor.py
r3309 r3335 1924 1924 self._language = val.lower() 1925 1925 else: 1926 dabo.errorLog.write(_("Currently only %s are supported" % ", ".join(LexerDic.keys())))1926 dabo.errorLog.write(_("Currently only %s are supported") % ", ".join(LexerDic.keys())) 1927 1927 self.setDefaults() 1928 1928 self._defaultsSet = True trunk/dabo/ui/uiwx/dForm.py
r3303 r3335 359 359 except dException.BusinessRuleViolation, e: 360 360 self.setStatusText(_("Save failed.")) 361 msg = "%s:\n\n%s" % (_("Save Failed"), _( str(e)))361 msg = "%s:\n\n%s" % (_("Save Failed"), str(e)) 362 362 self.notifyUser(msg, severe=True, exception=e) 363 363 return False … … 574 574 bizobj.new() 575 575 except dException.dException, e: 576 self.notifyUser(_("Add new record failed with response:\n\n%s" % str(e)),576 self.notifyUser(_("Add new record failed with response:\n\n%s") % str(e), 577 577 severe=True, exception=e) 578 578 … … 710 710 else: 711 711 rowNumber = 1 712 return _("Record %s/%s" % (rowNumber, rowCount))712 return _("Record %s/%s") % (rowNumber, rowCount) 713 713 714 714 trunk/dabo/ui/uiwx/dToggleButton.py
r3303 r3335 117 117 else: 118 118 state = ("up", "False") 119 self.Caption = _("State: %s (Boolean: %s)" % state)119 self.Caption = _("State: %s (Boolean: %s)") % state 120 120 121 121
