dabo Commit
Revision 5916
Date: 2010-07-10 08:14:21 -0700 (Sat, 10 Jul 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5916

Changed:
U   trunk/dabo/ui/dDataControlMixinBase.py
U   trunk/dabo/ui/uitk/dCheckBox.py
U   trunk/dabo/ui/uitk/dFormMixin.py
U   trunk/dabo/ui/uitk/dLabel.py
U   trunk/dabo/ui/uitk/dPemMixin.py

Log:
Converted more of the codebase from str() to ustr().

Diff:
Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py      2010-07-10 14:43:39 UTC (rev 
5915)
+++ trunk/dabo/ui/dDataControlMixinBase.py      2010-07-10 15:14:21 UTC (rev 
5916)
@@ -8,8 +8,10 @@
 from dabo.dObject import dObject
 from dabo.dPref import dPref
 from dabo.dLocalize import _
+from dabo.lib.utils import ustr
 
 
+
 class dDataControlMixinBase(dabo.ui.dControlMixin):
        """ Provide common functionality for the data-aware controls."""
        def __init__(self, *args, **kwargs):
@@ -253,7 +255,7 @@
                                                                if 
hasattr(self.DataSource, "_name"):
                                                                        nm = 
self.DataSource._name
                                                                else:
-                                                                       nm = 
str(self.DataSource)
+                                                                       nm = 
ustr(self.DataSource)
                                                                
dabo.errorLog.write("Could not bind to '%s.%s'\nReason: %s" % (nm, 
self.DataField, e) )
                        self._oldVal = curVal
                        self._from_flushValue = True
@@ -372,7 +374,7 @@
 
        def _setDataField(self, value):
                self._oldVal = None
-               self._DataField = str(value)
+               self._DataField = ustr(value)
 
 
        def _getDesignerMode(self):

Modified: trunk/dabo/ui/uitk/dCheckBox.py
===================================================================
--- trunk/dabo/ui/uitk/dCheckBox.py     2010-07-10 14:43:39 UTC (rev 5915)
+++ trunk/dabo/ui/uitk/dCheckBox.py     2010-07-10 15:14:21 UTC (rev 5916)
@@ -7,6 +7,7 @@
 import dDataControlMixin as dcm
 import dabo.dEvents as dEvents
 from dabo.dLocalize import _
+from dabo.lib.utils import ustr
 
 
 class dCheckBox(Tkinter.Checkbutton, dcm.dDataControlMixin):
@@ -65,9 +66,9 @@
 # 
 #      def _setAlignment(self, value):
 #              self._delWindowStyleFlag(wx.ALIGN_RIGHT)
-#              if str(value) == 'Right':
+#              if ustr(value) == 'Right':
 #                      self._addWindowStyleFlag(wx.ALIGN_RIGHT)
-#              elif str(value) == 'Left':
+#              elif ustr(value) == 'Left':
 #                      pass
 #              else:
 #                      raise ValueError("The only possible values are 'Left' 
and 'Right'.")

Modified: trunk/dabo/ui/uitk/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uitk/dFormMixin.py    2010-07-10 14:43:39 UTC (rev 5915)
+++ trunk/dabo/ui/uitk/dFormMixin.py    2010-07-10 15:14:21 UTC (rev 5916)
@@ -2,6 +2,7 @@
 """ dFormMixin.py """
 import dPemMixin as pm
 from dabo.dLocalize import _
+from dabo.lib.utils import ustr
 import dabo.dEvents as dEvents
 
 class dFormMixin(pm.dPemMixin):
@@ -256,7 +257,7 @@
 #              return {'editor': 'list', 'values': ['Normal', 'Minimized', 
'Maximized', 'FullScreen']}
 # 
 #      def _setWindowState(self, value):
-#              value = str(value)
+#              value = ustr(value)
 #              if value == 'Normal':
 #                      if self.IsFullScreen():
 #                              self.ShowFullScreen(False)

Modified: trunk/dabo/ui/uitk/dLabel.py
===================================================================
--- trunk/dabo/ui/uitk/dLabel.py        2010-07-10 14:43:39 UTC (rev 5915)
+++ trunk/dabo/ui/uitk/dLabel.py        2010-07-10 15:14:21 UTC (rev 5916)
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 import Tkinter, dabo, dabo.ui
+from dabo.lib.utils import ustr
 
 if __name__ == "__main__":
        dabo.ui.loadUI("tk")
@@ -52,7 +53,7 @@
 #              self._delWindowStyleFlag(wx.ALIGN_CENTRE)
 #              self._delWindowStyleFlag(wx.ALIGN_RIGHT)
 # 
-#              value = str(value)
+#              value = ustr(value)
 # 
 #              if value == 'Left':
 #                      self._addWindowStyleFlag(wx.ALIGN_LEFT)

Modified: trunk/dabo/ui/uitk/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uitk/dPemMixin.py     2010-07-10 14:43:39 UTC (rev 5915)
+++ trunk/dabo/ui/uitk/dPemMixin.py     2010-07-10 15:14:21 UTC (rev 5916)
@@ -5,7 +5,10 @@
 from dabo.dLocalize import _
 import dabo.ui.dPemMixinBase
 import dabo.dEvents as dEvents
+from dabo.lib.utils import ustr
 
+
+
 class dPemMixin(dabo.ui.dPemMixinBase.dPemMixinBase):
        """ Provide Property/Event/Method interfaces for dForms and dControls.
 
@@ -392,9 +395,9 @@
                        
        def _setCaption(self, caption):
                try:
-                       self.wm_title(str(caption))
+                       self.wm_title(ustr(caption))
                except AttributeError:
-                       self.configure(text=str(caption))
+                       self.configure(text=ustr(caption))
 
        def _getEnabled(self):
                return self.IsEnabled()
@@ -448,14 +451,14 @@
                        t.SetTip(value)
                else:
                        if value:
-                               t = wx.ToolTip(str(value))
+                               t = wx.ToolTip(ustr(value))
                                self.SetToolTip(t)
 
 
        def _getHelpContextText(self):
                return self.GetHelpText()
        def _setHelpContextText(self, value):
-               self.SetHelpText(str(value))
+               self.SetHelpText(ustr(value))
 
 
        def _getVisible(self):
@@ -507,7 +510,7 @@
                self._delWindowStyleFlag(wx.DOUBLE_BORDER)
                self._delWindowStyleFlag(wx.STATIC_BORDER)
 
-               style = str(style)
+               style = ustr(style)
 
                if style == 'None':
                        self._addWindowStyleFlag(wx.NO_BORDER)



_______________________________________________
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/[email protected]

Reply via email to