[Zope3-checkins] CVS: Zope3/src/zope/app/apidoc/classmodule -
browser.py:1.4
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Mar 29 00:27:50 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/apidoc/classmodule
In directory cvs.zope.org:/tmp/cvs-serv605/src/zope/app/apidoc/classmodule
Modified Files:
browser.py
Log Message:
Fix bugs with security proxies. Showing methods and attributes works again
finally.
=== Zope3/src/zope/app/apidoc/classmodule/browser.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/apidoc/classmodule/browser.py:1.3 Sun Mar 28 18:39:52 2004
+++ Zope3/src/zope/app/apidoc/classmodule/browser.py Mon Mar 29 00:27:49 2004
@@ -199,13 +199,14 @@
('write_perm', None)]
"""
attrs = []
- for name, attr, iface in self.context.getAttributes():
+ klass = removeAllProxies(self.context)
+ for name, attr, iface in klass.getAttributes():
entry = {'name': name,
'value': `attr`,
'type': type(attr).__name__,
'type_link': _getTypePath(type(attr)),
'interface': getPythonPath(iface)}
- checker = removeAllProxies(self.context.getSecurityChecker())
+ checker = removeAllProxies(klass.getSecurityChecker())
entry.update(getPermissionIds(name, checker))
attrs.append(entry)
return attrs
@@ -242,15 +243,14 @@
('doc', '')]]
"""
methods = []
- for name, attr, iface in self.context.getMethods():
- if inspect.ismethod(attr):
- entry = {'name': name,
- 'signature': getFunctionSignature(attr),
- 'doc': stx2html(attr.__doc__ or ''),
- 'interface': getPythonPath(iface)}
- entry.update(getPermissionIds(
- name, self.context.getSecurityChecker()))
- methods.append(entry)
+ klass = removeAllProxies(self.context)
+ for name, attr, iface in klass.getMethods():
+ entry = {'name': name,
+ 'signature': getFunctionSignature(attr),
+ 'doc': stx2html(attr.__doc__ or ''),
+ 'interface': getPythonPath(iface)}
+ entry.update(getPermissionIds(name, klass.getSecurityChecker()))
+ methods.append(entry)
return methods
More information about the Zope3-Checkins
mailing list