dabo Commit
Revision 7036
Date: 2011-12-28 10:36:08 -0800 (Wed, 28 Dec 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7036
Changed:
U trunk/dabo/lib/doDefaultMixin.py
U trunk/ide/ClassDesignerComponents.py
U trunk/ide/MenuDesignerComponents.py
U trunk/ide/ReportDesigner.py
Log:
Deprecated cls.doDefault(), which was a precursor to self.super().
Diff:
Modified: trunk/dabo/lib/doDefaultMixin.py
===================================================================
--- trunk/dabo/lib/doDefaultMixin.py 2011-12-28 18:07:01 UTC (rev 7035)
+++ trunk/dabo/lib/doDefaultMixin.py 2011-12-28 18:36:08 UTC (rev 7036)
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-
import inspect
+import warnings
+deprecation_warnings_issued = []
+
+
class DoDefaultMixin(object):
"""
An alternative way to call superclass method code.
@@ -40,6 +44,12 @@
self = frame.f_locals["self"]
methodName = frame.f_code.co_name
+ if (cls, methodName) not in deprecation_warnings_issued:
+ warnings.warn("""
+ doDefault() deprecated since r7335. Please replace your doDefault() call
with:
+ super(%s, self).%s(<args>)""" % (cls.__name__, methodName),
DeprecationWarning, 2)
+ deprecation_warnings_issued.append((cls, methodName))
+
# If the super() class doesn't have the method attribute, we'll
pass silently
# because that is what the user will expect: they probably
defined the method
# in their code but out of habit used the doDefault() call
anyway.
Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py 2011-12-28 18:07:01 UTC (rev
7035)
+++ trunk/ide/ClassDesignerComponents.py 2011-12-28 18:36:08 UTC (rev
7036)
@@ -1584,7 +1584,7 @@
def _getDesProps(self):
- ret = LayoutBorderSizer.doDefault()
+ ret = super(LayoutBorderSizer, self)._getDesProps()
ret.update({"Caption" : {"type" : unicode, "readonly" : False},
"BackColor" : {"type" : "color", "readonly" :
False,
"customEditor": "editColor"},
Modified: trunk/ide/MenuDesignerComponents.py
===================================================================
--- trunk/ide/MenuDesignerComponents.py 2011-12-28 18:07:01 UTC (rev 7035)
+++ trunk/ide/MenuDesignerComponents.py 2011-12-28 18:36:08 UTC (rev 7036)
@@ -496,7 +496,7 @@
def _getDesignerProps(self):
- ret = self.doDefault()
+ ret = super(CaptionBitmapPanel, self)._getDesignerProps()
ret.update({"Picture": {"type" : "path", "readonly" : False,
"customEditor": "editStdPicture"}})
return ret
Modified: trunk/ide/ReportDesigner.py
===================================================================
--- trunk/ide/ReportDesigner.py 2011-12-28 18:07:01 UTC (rev 7035)
+++ trunk/ide/ReportDesigner.py 2011-12-28 18:36:08 UTC (rev 7036)
@@ -877,7 +877,7 @@
class ObjectTreeForm(DesignerControllerForm):
def initProperties(self):
- ObjectTreeForm.doDefault()
+ super(ObjectTreeForm, self).initProperties()
self.Caption = "Report Object Tree"
self.EditorClass = ReportObjectTree
@@ -891,7 +891,7 @@
self.app = rdc
def afterInit(self):
- ReportPropSheet.doDefault()
+ super(ReportPropSheet, self).afterInit()
self.addObject(dabo.ui.dLabel, Name="lblType", FontBold=True)
self.Sizer.insert(0, self.lblType, "expand", halign="left",
border=10)
self.Sizer.insertSpacer(0, 10)
@@ -948,12 +948,12 @@
if rgbTuple is None:
rgbTuple = (0, 0, 0)
rgbTuple =
rdc.ActiveEditor._rw.getColorTupleFromReportLab(rgbTuple)
- ReportPropSheet.doDefault(objs, prop, rgbTuple)
+ super(ReportPropSheet, self).editColor(objs, prop, val)
class PropSheetForm(DesignerControllerForm):
def initProperties(self):
- PropSheetForm.doDefault()
+ super(PropSheetForm, self).initProperties()
self.Caption = "Report Properties"
self.EditorClass = ReportPropSheet
self.Controller = self.Application ## r7033 changed to allow
for non-application controllers.
@@ -1874,7 +1874,7 @@
def refresh(self):
- ReportDesigner.doDefault()
+ super(ReportDesigner, self).refresh()
self.showPosition()
self.setCaption()
_______________________________________________
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]