[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
Reinstantiated some removeAllProxies calls,
since we need do not want the
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Aug 26 09:32:42 EDT 2004
Log message for revision 27277:
Reinstantiated some removeAllProxies calls, since we need do not want the
location proxy's mosule, but the interface's.
Changed:
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py 2004-08-26 13:23:57 UTC (rev 27276)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py 2004-08-26 13:32:42 UTC (rev 27277)
@@ -242,8 +242,9 @@
>>> details.getDoc()[:34]
'<h1>This is the Foo interface</h1>'
"""
- # We must remove all security proxies here, so that we get the context's
- # __module__ attribute.
+ # We must remove all proxies here, so that we get the context's
+ # __module__ attribute. If we only remove security proxies, the
+ # location proxy's module will be returned.
return renderText(self.context.__doc__,
zapi.removeSecurityProxy(self.context).__module__)
@@ -314,8 +315,9 @@
"""
# The `Interface` and `Attribute` class have no security declarations,
# so that we are not able to access any API methods on proxied
- # objects.
- iface = zapi.removeSecurityProxy(self.context)
+ # objects. If we only remove security proxies, the location proxy's
+ # module will be returned.
+ iface = removeAllProxies(self.context)
attrs = []
for name in iface:
attr = iface[name]
@@ -344,12 +346,14 @@
('signature', '(key, default=None)')]]
"""
# The `Interface` class have no security declarations, so that we are
- # not able to access any API methods on proxied objects.
+ # not able to access any API methods on proxied objects. If we only
+ # remove security proxies, the location proxy's module will be
+ # returned.
return [{'name': method.getName(),
'signature': method.getSignatureString(),
'doc': renderText(
method.getDoc() or '',
- zapi.removeSecurityProxy(self.context).__module__)}
+ removeAllProxies(self.context).__module__)}
for method in _get(self.context, IMethod).values()]
def getFields(self):
@@ -384,7 +388,9 @@
('required', u'optional')]]
"""
# The `Interface` class have no security declarations, so that we are
- # not able to access any API methods on proxied objects.
+ # not able to access any API methods on proxied objects. If we only
+ # remove security proxies, the location proxy's module will be
+ # returned.
fields = map(lambda x: x[1], _getInOrder(self.context, IField))
return [{'name': field.getName(),
'iface': _getFieldInterface(field),
@@ -393,7 +399,7 @@
'default': field.default.__repr__(),
'description': renderText(
field.description or '',
- zapi.removeSecurityProxy(self.context).__module__)}
+ removeAllProxies(self.context).__module__)}
for field in fields]
def getRequiredAdapters(self):
More information about the Zope3-Checkins
mailing list