dabo Commit
Revision 1401
Date: 2005-10-04 14:27:00 -0700 (Tue, 04 Oct 2005)
Author: paul
Changed:
U trunk/dabo/common/dObject.py
U trunk/dabo/common/propertyHelperMixin.py
Log:
Removed getApiDoc() as it is now in dabodoc. Added a refresh option to
getPropertyList() and getMethodList(), because for some reason they were
getting populated once without all the attributes accounted for.
Diff:
Modified: trunk/dabo/common/dObject.py
===================================================================
--- trunk/dabo/common/dObject.py 2005-10-04 18:14:51 UTC (rev 1400)
+++ trunk/dabo/common/dObject.py 2005-10-04 21:27:00 UTC (rev 1401)
@@ -128,13 +128,16 @@
return '.'.join(names)
- def getMethodList(cls):
+ def getMethodList(cls, refresh=False):
"""Return the list of (Dabo) methods for this class or
instance."""
try:
methodList = cls.__methodList
except:
methodList = None
+ if refresh:
+ methodList = None
+
if isinstance(methodList, list):
## A prior call has already generated the methodList
return methodList
@@ -153,58 +156,6 @@
getMethodList = classmethod(getMethodList)
- def getApiDoc(cls, outputType="html-single"):
- PEM_COLUMNS = float(3) ## float simply for round() to work
right
-
- className = cls.__name__
- classDoc = cls.__doc__
- if classDoc is None:
- classDoc = ""
- classDoc = "<br>".join(classDoc.split("\n"))
-
- html = """
-<h1>Class %(className)s</h1>
-<p>%(classDoc)s</p>
-<hr>
-""" % locals()
-
- def getListing(name, items):
- html = """
-<h2>%(name)s</h2>
-<table width="100%%" cellpadding="5" cellspacing="0" border="0">
-""" % locals()
-
- for idx, item in enumerate(items):
- definedHere = (cls.__dict__.has_key(item))
- if idx % PEM_COLUMNS == 0:
- if idx > 0:
- html += """ </tr>
-"""
- html += """ <tr>
-"""
- if definedHere:
- html += """ <td><b><a
href="#prop_%(item)s">%(item)s</a></b></td>
-""" % locals()
- else:
- html += """ <td><a
href="#prop_%(item)s">%(item)s</a></td>
-""" % locals()
-
- html += """
- </tr>
-</table>
-<hr>
-"""
- return html
-
- # Property, Event, Method Listings:
- html += getListing("Properties", cls.getPropertyList())
- html += getListing("Events", cls.getEventList())
- html += getListing("Methods", cls.getMethodList())
-
- return html
- getApiDoc = classmethod(getApiDoc)
-
-
def _getBaseClass(self):
# Every Dabo baseclass must set self._baseClass explicitly, to
itself. For instance:
# class dBackend(object)
Modified: trunk/dabo/common/propertyHelperMixin.py
===================================================================
--- trunk/dabo/common/propertyHelperMixin.py 2005-10-04 18:14:51 UTC (rev
1400)
+++ trunk/dabo/common/propertyHelperMixin.py 2005-10-04 21:27:00 UTC (rev
1401)
@@ -199,7 +199,7 @@
raise ValueError, "Could not set
property '%s' to value: %s" % (prop, val)
- def getPropertyList(cls):
+ def getPropertyList(cls, refresh=False):
""" Returns the list of properties for this object (class or
instance).
"""
try:
@@ -207,6 +207,9 @@
except:
propList = None
+ if refresh:
+ propList = None
+
if isinstance(propList, list):
## A prior call has already generated the propList
return propList
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev