dabo Commit
Revision 5558
Date: 2009-12-19 10:17:02 -0800 (Sat, 19 Dec 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5558
Changed:
U trunk/ide/ClassDesigner.py
U trunk/ide/ClassDesignerComponents.py
Log:
Improved the handling of custom classes. Pathing issues had crept into the code
that prevented custom classes from being properly inherited when added to other
designs; these changes should fix that.
Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py 2009-12-19 18:13:48 UTC (rev 5557)
+++ trunk/ide/ClassDesigner.py 2009-12-19 18:17:02 UTC (rev 5558)
@@ -674,12 +674,18 @@
# See if this is a saved class inserted into another
design
isCustomClass = False
customClassPath = None
- if os.path.exists(clsname) and atts.has_key("classID"):
+ if "classID" in atts:
+ # This is a custom class; make sure that the
relative path is correct
+ if not os.path.exists(clsname):
+ clsname =
dabo.lib.utils.locateRelativeTo(self._basePath, clsname)
isCustomClass = True
customClassPath = clsname
# Start with the custom class, and then update
it with the current stuff
self.extractSuperClassInfo(clsname)
+ # Add any superclass information.
self.inherit(dct)
+ # Need to re-assign the atts from the inherited dct
+ atts = dct["attributes"]
cls = dct["name"]
classID = self._extractKey(atts, "classID", "")
kids = dct.get("children", None)
Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py 2009-12-19 18:13:48 UTC (rev
5557)
+++ trunk/ide/ClassDesignerComponents.py 2009-12-19 18:17:02 UTC (rev
5558)
@@ -98,9 +98,11 @@
relPath = self._classFile
else:
relPath = self.Form._classFile
- rp = dabo.lib.utils.relativePath(clsRef, relPath)
- if not rp:
+ if not relPath:
relPath = os.path.split(relPath)[0]
+ if clsRef == relPath:
+ rp = clsRef
+ else:
rp = dabo.lib.utils.relativePath(clsRef,
relPath)
ra["designerClass"] =
dabo.lib.utils.getPathAttributePrefix() + rp
ra["savedClass"] = True
@@ -1034,7 +1036,6 @@
szType = self.Orientation
except AttributeError:
szType = None
-
for kid in kids:
isSpacer = False
numItems = len(ret)
@@ -1074,6 +1075,7 @@
szrDict = {}
except AttributeError:
szrDict = {}
+
kidDict =
kidItem.getDesignerDict(itemNum=numItems,
classDict=szrDict)
else:
_______________________________________________
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]