dabo Commit
Revision 4119
Date: 2008-06-08 09:39:13 -0700 (Sun, 08 Jun 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4119

Changed:
U   trunk/dabo/lib/eventMixin.py
U   trunk/dabo/ui/dialogs/Wizard.py
U   trunk/dabo/ui/uiwx/dFormMixin.py
U   trunk/dabo/ui/uiwx/dGridSizer.py
U   trunk/dabo/ui/uiwx/dMenu.py
U   trunk/dabo/ui/uiwx/dSizer.py
U   trunk/dabo/ui/uiwx/dToggleButton.py
U   trunk/dabo/ui/uiwx/dToolBar.py

Log:
Removed all the deprecated code for 0.9.


Diff:
Modified: trunk/dabo/lib/eventMixin.py
===================================================================
--- trunk/dabo/lib/eventMixin.py        2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/lib/eventMixin.py        2008-06-08 16:39:13 UTC (rev 4119)
@@ -2,7 +2,6 @@
 import string
 import types
 import traceback
-import warnings
 import dabo
 from dabo.dLocalize import _
 
@@ -318,14 +317,6 @@
        getValidEvents = classmethod(getValidEvents)
 
 
-       # Allow for alternate capitalization (deprecated):
-       def unBindEvent(self, *args, **kwargs):
-               """Deprecated; see unbindEvent."""
-               warnings.warn("unBindEvent is deprecated and will be removed in 
0.9; "
-                               "change to unbindEvent", DeprecationWarning)
-               return self.unbindEvent(*args, **kwargs)
-
-
        def _removeAutoBindings(self):
                """Remove all event bindings originally set by 
autoBindEvents()."""
                toRemove = []

Modified: trunk/dabo/ui/dialogs/Wizard.py
===================================================================
--- trunk/dabo/ui/dialogs/Wizard.py     2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/dialogs/Wizard.py     2008-06-08 16:39:13 UTC (rev 4119)
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-import warnings
 import dabo
 dabo.ui.loadUI("wx")
 from dabo.dLocalize import _
@@ -17,12 +16,6 @@
        
        def __init__(self, parent=None, properties=None, *args, **kwargs):
                pgs = self._extractKey(kwargs, "Pages")
-               # Backwards compatibility; deprecated in 0.9
-               img = self._extractKey(kwargs, "image")
-               if img:
-                       warnmsg = _("Deprecated parameter 'image' used in 
wizard. Use the 'Picture' property instead.")
-                       warnings.warn(warnmsg, DeprecationWarning, stacklevel=2)
-                       kwargs["Picture"] = img
                kwargs["BorderResizable"] = kwargs.get("BorderResizable", False)
                kwargs["ShowMaxButton"] = kwargs.get("ShowMaxButton", False)
                kwargs["ShowMinButton"] = kwargs.get("ShowMinButton", False)

Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py    2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dFormMixin.py    2008-06-08 16:39:13 UTC (rev 4119)
@@ -535,10 +535,10 @@
                menu.append(caption, OnHit=function, bmp=bitmap)
 
 
-       def appendToolBarButton(self, name, pic, bindfunc=None, toggle=False, 
-                       tip="", help="", *args, **kwargs):
-               self.ToolBar.appendButton(name, pic, bindfunc=bindfunc, 
toggle=toggle, 
-                               tip=tip, help=help, *args, **kwargs)
+       def appendToolBarButton(self, name, pic, toggle=False, tip="", help="", 
+                       *args, **kwargs):
+               self.ToolBar.appendButton(name, pic, toggle=toggle, tip=tip, 
+                               help=help, *args, **kwargs)
 
 
        def fillPreferenceDialog(self, dlg):

Modified: trunk/dabo/ui/uiwx/dGridSizer.py
===================================================================
--- trunk/dabo/ui/uiwx/dGridSizer.py    2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dGridSizer.py    2008-06-08 16:39:13 UTC (rev 4119)
@@ -5,7 +5,6 @@
 import dSizerMixin
 from dabo.dLocalize import _
 from dabo.ui import makeDynamicProperty
-import warnings
 
 
 class dGridSizer(dSizerMixin.dSizerMixin, wx.GridBagSizer):
@@ -35,21 +34,6 @@
                self._colExpandState = {}
 
                properties = self._extractKeywordProperties(kwargs, {})
-               if kwargs:
-                       # Clean up the deprecated old parameters
-                       delKeys = []
-                       oldNewMap = {"vgap": "VGap", "hgap": "HGap", "maxRows": 
"MaxRows", "maxCols": "MaxCols"}
-                       oldParams = oldNewMap.keys()
-                       for k,v in kwargs.items():
-                               if k in oldParams:
-                                       newProp = oldNewMap[k]
-                                       warnmsg = _("Deprecated parameter 
'%(k)s' used. Use the '%(newProp)s' property instead.") % locals()
-                                       warnings.warn(warnmsg, 
DeprecationWarning, stacklevel=2)
-                                       delKeys.append(k)
-                                       properties[oldNewMap[k]] = v
-                       for k in delKeys:
-                               del kwargs[k]
-               
                if not ("MaxCols" in properties) and not ("MaxRows" in 
properties):
                        # Default to 2 columns if nothing else specified
                        properties["MaxCols"] = 2

Modified: trunk/dabo/ui/uiwx/dMenu.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenu.py 2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dMenu.py 2008-06-08 16:39:13 UTC (rev 4119)
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 import sys
-import warnings
 import wx
 import dabo
 if __name__ == "__main__":
@@ -210,67 +209,58 @@
                return self.PrependSeparator()
        
 
-       def append(self, caption, bindfunc=None, help="", bmp=None, 
picture=None,
+       def append(self, caption, help="", bmp=None, picture=None,
                        menutype="", *args, **kwargs):
                """Append a dMenuItem with the specified properties.
 
                This is a convenient way to add a dMenuItem to a dMenu, give it 
a caption,
                help string, bitmap, and also bind it to a function, all in one 
call.
                
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-
                Any additional keyword arguments passed will be interpreted as 
properties
                of the dMenuItem: if valid property names/values, the dMenuItem 
will take
                them on; if not valid, an exception will be raised.
                """
                if picture is None:
                        picture = bmp
-               item = self._getItem(bindfunc, help, picture, menutype, *args, 
**kwargs)
+               item = self._getItem(help, picture, menutype, *args, **kwargs)
                self.appendItem(item)
                item.Caption = caption
                return item
 
 
-       def insert(self, pos, caption, bindfunc=None, help="", bmp=None, 
picture=None,
+       def insert(self, pos, caption, help="", bmp=None, picture=None,
                        menutype="", *args, **kwargs):
                """Insert a dMenuItem at the given position with the specified 
properties.
 
                This is a convenient way to add a dMenuItem to a dMenu, give it 
a caption,
                help string, bitmap, and also bind it to a function, all in one 
call.
 
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-
                Any additional keyword arguments passed will be interpreted as 
properties
                of the dMenuItem: if valid property names/values, the dMenuItem 
will take
                them on; if not valid, an exception will be raised.
                """
                if picture is None:
                        picture = bmp
-               item = self._getItem(bindfunc, help, picture, menutype, *args, 
**kwargs)
+               item = self._getItem(help, picture, menutype, *args, **kwargs)
                self.insertItem(pos, item)
                item.Caption = caption
                return item
                
 
-       def prepend(self, caption, bindfunc=None, help="", bmp=None, 
picture=None,
+       def prepend(self, caption, help="", bmp=None, picture=None,
                        menutype="", *args, **kwargs):
                """Prepend a dMenuItem with the specified properties.
 
                This is a convenient way to add a dMenuItem to a dMenu, give it 
a caption,
                help string, bitmap, and also bind it to a function, all in one 
call.
 
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-
                Any additional keyword arguments passed will be interpreted as 
properties
                of the dMenuItem: if valid property names/values, the dMenuItem 
will take
                them on; if not valid, an exception will be raised.
                """
                if picture is None:
                        picture = bmp
-               item = self._getItem(bindfunc, help, picture, menutype, *args, 
**kwargs)
+               item = self._getItem(help, picture, menutype, *args, **kwargs)
                self.prependItem(item)
                item.Caption = caption
                return item
@@ -362,10 +352,7 @@
                return ret
                
                        
-       def _getItem(self, bindfunc, help, icon, menutype, *args, **kwargs):
-               if bindfunc is not None:
-                       warnings.warn(_("Deprecated; use 'OnHit=<func>' 
instead."), 
-                                       DeprecationWarning, 1)
+       def _getItem(self, help, icon, menutype, *args, **kwargs):
                itmtyp = self._getItemType(menutype)
                itmid = self._getItemID(menutype)
                if itmid != wx.ID_DEFAULT:
@@ -378,8 +365,6 @@
                                CheckItemType: dabo.ui.dCheckMenuItem,
                                RadioItemType: dabo.ui.dRadioMenuItem}[itmtyp]
                itm = cls(self, HelpText=help, Icon=icon, kind=itmtyp, *args, 
**kwargs)
-               if bindfunc:
-                       itm.bindEvent(dEvents.Hit, bindfunc)
                if itmSpecial:
                        itm._special = itmSpecial
                return itm

Modified: trunk/dabo/ui/uiwx/dSizer.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizer.py        2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dSizer.py        2008-06-08 16:39:13 UTC (rev 4119)
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-import warnings
 import wx
 import dabo
 import dPemMixin
@@ -16,11 +15,6 @@
                        # The orientation was passed as a standalong argument
                        kwargs["Orientation"] = args[0]
                        args = tuple(args[1:])
-               if "orientation" in kwargs:
-                       warnmsg = _("Deprecated parameter 'orientation' used. 
Use the 'Orientation' property instead.")
-                       warnings.warn(warnmsg, DeprecationWarning, stacklevel=2)
-                       kwargs["Orientation"] = kwargs["orientation"]
-                       del kwargs["orientation"]
 
                properties = self._extractKey(kwargs, "properties", {})
                orient = self._extractKey((kwargs, properties), "Orientation", 
"h")

Modified: trunk/dabo/ui/uiwx/dToggleButton.py
===================================================================
--- trunk/dabo/ui/uiwx/dToggleButton.py 2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dToggleButton.py 2008-06-08 16:39:13 UTC (rev 4119)
@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-
 import wx
 import  wx.lib.buttons as wxb
-import warnings
 import dabo
 
 if __name__ == "__main__":

Modified: trunk/dabo/ui/uiwx/dToolBar.py
===================================================================
--- trunk/dabo/ui/uiwx/dToolBar.py      2008-06-08 16:38:37 UTC (rev 4118)
+++ trunk/dabo/ui/uiwx/dToolBar.py      2008-06-08 16:39:13 UTC (rev 4119)
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 import os.path
-import warnings
 import wx
 import dabo, dabo.ui
 
@@ -96,8 +95,8 @@
                return item
 
 
-       def appendButton(self, caption, pic, bindfunc=None, toggle=False, 
-                       tip="", help="", *args, **kwargs):
+       def appendButton(self, caption, pic, toggle=False, tip="", 
+                       help="", *args, **kwargs):
                """Adds a tool (button) to the toolbar. 
 
                You must pass a caption and an image for the button. The 
picture can be a 
@@ -105,16 +104,13 @@
                toggle=True, the button will exist in an up and down state. 
Pass the 
                function you want to be called when this button is clicked in 
an 
                'OnHit' param.
-
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
                """
-               return self._appendInsertButton(None, caption, pic, bindfunc, 
-                               toggle, tip, help, *args, **kwargs)
+               return self._appendInsertButton(None, caption, pic, toggle,     
tip, 
+                               help, *args, **kwargs)
 
 
-       def insertButton(self, pos, caption, pic, bindfunc=None, toggle=False, 
-                       tip="", help="", *args, **kwargs):
+       def insertButton(self, pos, caption, pic, toggle=False, tip="", 
+                       help="", *args, **kwargs):
                """Inserts a tool (button) to the toolbar at the specified 
position. 
 
                You must pass a caption and an image for the button. The 
picture can be a 
@@ -122,16 +118,13 @@
                toggle=True, the button will exist in an up and down state. 
Pass the 
                function you want to be called when this button is clicked in 
an 
                'OnHit' param.
-
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
                """
-               return self._appendInsertButton(pos, caption, pic, bindfunc, 
-                               toggle, tip, help, *args, **kwargs)
+               return self._appendInsertButton(pos, caption, pic, toggle,      
tip, 
+                               help, *args, **kwargs)
 
 
-       def prependButton(self, caption, pic, bindfunc=None, toggle=False, 
-                       tip="", help="", *args, **kwargs):
+       def prependButton(self, caption, pic, toggle=False, tip="", help="", 
+                       *args, **kwargs):
                """Inserts a tool (button) to the beginning of the toolbar. 
 
                You must pass a caption and an image for the button. The 
picture can be a 
@@ -139,15 +132,12 @@
                toggle=True, the button will exist in an up and down state. 
Pass the 
                function you want to be called when this button is clicked in 
an 
                'OnHit' param.
-
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
                """
-               return self.insertButton(0, caption, pic, bindfunc, toggle,     
tip, help, *args, **kwargs)
+               return self.insertButton(0, caption, pic, toggle,       tip, 
help, *args, **kwargs)
 
 
-       def _appendInsertButton(self, pos, caption, pic, bindfunc, toggle, 
-                       tip, help, *args, **kwargs):
+       def _appendInsertButton(self, pos, caption, pic, toggle, tip, help, 
+                       *args, **kwargs):
                """Common code for the append|insert|prependButton() 
functions."""
                if isinstance(pic, basestring):
                        # path was passed
@@ -189,11 +179,6 @@
                        ## The AssertionError: not implemented occurs on wxMac, 
even though
                        ## SetToggle() obviously is implemented, because it 
does work.
                        pass
-
-               if bindfunc is not None:
-                       warnings.warn(_("Deprecated; use 'OnHit=<func>' 
instead."), 
-                                       DeprecationWarning, 1)
-                       butt.bindEvent(dEvents.Hit, bindfunc)
                self._realize()
                
                # Store the button reference
@@ -207,18 +192,10 @@
                return butt
                        
 
-       def appendControl(self, control, bindfunc=None):
-               """Adds any Dabo Control to the toolbar. 
-
-               Optionally, pass the function you want to be called when this 
button is 
-               clicked in the bindfunc parameter.
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-               """
+       def appendControl(self, control):
+               """Adds any Dabo Control to the toolbar."""
                butt = self.AddControl(control)
                butt.SetLabel(control.Caption)
-               if bindfunc:
-                       control.bindEvent(dEvents.Hit, bindfunc)
                self._realize()
                
                # Store the control reference:
@@ -227,18 +204,10 @@
                return control
 
 
-       def insertControl(self, pos, control, bindfunc=None):
-               """Inserts any Dabo Control to the toolbar at the specified 
position. 
-
-               Optionally, pass the function you want to be called when this 
button is 
-               clicked in the bindfunc parameter.
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-               """
+       def insertControl(self, pos, control):
+               """Inserts any Dabo Control to the toolbar at the specified 
position."""
                butt = self.InsertControl(pos, control)
                butt.SetLabel(control.Caption)
-               if bindfunc:
-                       control.bindEvent(dEvents.Hit, bindfunc)
                self._realize()
                
                # Store the control reference:
@@ -247,17 +216,11 @@
                return control
 
 
-       def prependControl(self, control, bindfunc=None):
-               """Inserts any Dabo Control to the beginning of the toolbar. 
+       def prependControl(self, control):
+               """Inserts any Dabo Control to the beginning of the toolbar. """
+               return self.insertControl(0, control)
 
-               Optionally, pass the function you want to be called when this 
button is 
-               clicked in the bindfunc parameter.
-               NOTE: use of the bindfunc parameter is deprecated in version 
0.8 and will be
-               removed in version 0.9. Send an OnHit parameter instead.
-               """
-               return self.insertControl(0, control, bindfunc)
 
-
        def appendSeparator(self):
                """Inserts a separator at the end of the toolbar."""
                sep = dToolBarItem(self.AddSeparator())




_______________________________________________
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