[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/ For methods
getPythonPath now returns the class path
Dmitry Vasiliev
dima at hlabs.spb.ru
Tue Jul 27 03:37:40 EDT 2004
Log message for revision 26775:
For methods getPythonPath now returns the class path
Changed:
U Zope3/trunk/src/zope/app/apidoc/tests.py
U Zope3/trunk/src/zope/app/apidoc/utilities.py
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/tests.py 2004-07-27 06:58:12 UTC (rev 26774)
+++ Zope3/trunk/src/zope/app/apidoc/tests.py 2004-07-27 07:37:40 UTC (rev 26775)
@@ -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/trunk/src/zope/app/apidoc/utilities.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/utilities.py 2004-07-27 06:58:12 UTC (rev 26774)
+++ Zope3/trunk/src/zope/app/apidoc/utilities.py 2004-07-27 07:37:40 UTC (rev 26775)
@@ -129,7 +129,8 @@
>>> class ISample(Interface):
... pass
>>> class Sample(object):
- ... pass
+ ... def sample(self):
+ ... pass
>>> getPythonPath(ISample)
'zope.app.apidoc.utilities.ISample'
@@ -137,6 +138,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:
@@ -145,6 +151,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__)
@@ -202,9 +210,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