[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py The presentation service is gone.

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 17 12:15:42 EDT 2004


Log message for revision 27572:
  
  The presentation service is gone.
  
  Now that the adapter service also contains the view, make sure not to list
  views as adapters.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py


-=-
Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py	2004-09-17 16:15:40 UTC (rev 27571)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/browser.py	2004-09-17 16:15:42 UTC (rev 27572)
@@ -22,6 +22,7 @@
 from zope.interface.declarations import providedBy
 from zope.interface.interfaces import IMethod, IInterface 
 from zope.proxy import removeAllProxies
+from zope.publisher.interfaces import IRequest
 from zope.schema.interfaces import IField
 from zope.security.proxy import removeSecurityProxy
 
@@ -414,7 +415,7 @@
 
           >>> adapters = details.getRequiredAdapters()
           >>> adapters.sort()
-          >>> pprint(adapters)
+          >>> pprint(adapters[:2])
           [[('factory', 'None.append'),
             ('factory_url', 'None/append'),
             ('name', None),
@@ -439,6 +440,10 @@
             if reg.required and reg.required[0] is not None and \
                    iface not in reg.required:
                 continue
+            # Ignore views
+            if IInterface.providedBy(reg.required[-1]) and \
+                   reg.required[-1].isOrExtends(IRequest):
+                continue
             factory = _getRealFactory(reg.value)
             path = getPythonPath(factory)
             if type(factory) in (FunctionType, MethodType):
@@ -481,6 +486,10 @@
             # Only grab adapters for which this interface is provided
             if iface is not reg.provided:
                 continue
+            # Ignore views
+            if IInterface.providedBy(reg.required[-1]) and \
+                   reg.required[-1].isOrExtends(IRequest):
+                continue
             factory = _getRealFactory(reg.value)
             path = getPythonPath(factory)
             if type(factory) in (FunctionType, MethodType):



More information about the Zope3-Checkins mailing list