dabo Commit
Revision 3128
Date: 2007-05-14 19:04:10 -0700 (Mon, 14 May 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3128

Changed:
U   trunk/dabo/lib/propertyHelperMixin.py

Log:
Fixed getPropertyList() to once again return all properties by default, which
should fix John Fabiani's problem introduced in [3121]. Added a onlyDabo 
argument which, when True, will stop getting the property list below dObject,
which is the behavior I want for dabodoc. 

Everyone happy? ;)



Diff:
Modified: trunk/dabo/lib/propertyHelperMixin.py
===================================================================
--- trunk/dabo/lib/propertyHelperMixin.py       2007-05-12 00:06:17 UTC (rev 
3127)
+++ trunk/dabo/lib/propertyHelperMixin.py       2007-05-15 02:04:10 UTC (rev 
3128)
@@ -247,28 +247,25 @@
                        self.bindEvent(evt, mthd)
 
                
-       def getPropertyList(cls, refresh=False):
-               """ Returns the list of properties for this object (class or 
instance)."""
-               try:
-                       propLists = cls._propLists
-               except:
-                       propLists = None
+       def getPropertyList(cls, refresh=False, onlyDabo=False):
+               """ Returns the list of properties for this object (class or 
instance).
 
-               try:
-                       propList = cls._propLists[cls]
-               except:
-                       propList = None
+               If refresh is passed, the cached property list (if any) will be 
rebuilt.
+               If onlyDabo is passed, we won't list the properties underneath 
the 
+               __mro__ of dObject.
+               """
+               propLists = getattr(cls, "_propLists", {})
+               propList = propLists.get((cls, onlyDabo), [])
 
                if refresh:
-                       propList = None
+                       propList = []
 
-               if isinstance(propList, list):
+               if propList:
                        ## A prior call has already generated the propList
                        return propList
 
-               propList = []
                for c in cls.__mro__:
-                       if c is PropertyHelperMixin:
+                       if onlyDabo and c is PropertyHelperMixin:
                                # Don't list properties lower down (e.g., from 
wxPython):
                                break
                        for item in dir(c):
@@ -280,7 +277,7 @@
                propList.sort()
                if not hasattr(cls, "_propLists"):
                        cls._propLists = {}
-               cls._propLists[cls] = propList
+               cls._propLists[(cls, onlyDabo)] = propList
                return propList
        getPropertyList = classmethod(getPropertyList)
 




_______________________________________________
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/dabo-dev/[EMAIL PROTECTED]

Reply via email to