[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/
Merged changes from trunk revision 26775
Dmitry Vasiliev
dima at hlabs.spb.ru
Tue Jul 27 03:41:49 EDT 2004
Log message for revision 26776:
Merged changes from trunk revision 26775
Changed:
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py 2004-07-27 07:37:40 UTC (rev 26775)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py 2004-07-27 07:41:49 UTC (rev 26776)
@@ -101,7 +101,7 @@
# setUp=setUp, tearDown=tearDown),
#DocTestSuite('zope.app.apidoc.browser.apidoc',
# setUp=setUp, tearDown=tearDown),
- #DocTestSuite('zope.app.apidoc.utilities'),
+ DocTestSuite('zope.app.apidoc.utilities'),
DocTestSuite('zope.app.apidoc.tests'),
))
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py 2004-07-27 07:37:40 UTC (rev 26775)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py 2004-07-27 07:41:49 UTC (rev 26776)
@@ -126,7 +126,8 @@
>>> class ISample(Interface):
... pass
>>> class Sample(object):
- ... pass
+ ... def sample(self):
+ ... pass
>>> getPythonPath(ISample)
'zope.app.apidoc.utilities.ISample'
@@ -134,6 +135,11 @@
>>> getPythonPath(Sample)
'zope.app.apidoc.utilities.Sample'
+ For methods getPythonPath returns the class path:
+
+ >>> getPythonPath(Sample.sample)
+ 'zope.app.apidoc.utilities.Sample'
+
>>> try:
... getPythonPath(Sample())
... except AttributeError:
@@ -142,6 +148,8 @@
"""
if obj is None:
return None
+ if hasattr(obj, "im_class"):
+ obj = obj.im_class
module = obj.__module__
return '%s.%s' %(module, obj.__name__)
@@ -223,9 +231,9 @@
>>> entries = getPermissionIds('attr2', klass=Sample)
>>> print entries['read_perm']
- N/A
+ n/a
>>> print entries['write_perm']
- N/A
+ n/a
Sample2 does not have a checker.
More information about the Zope3-Checkins
mailing list