[Checkins] SVN: zc.resourcelibrary/trunk/ - Look up the "resources view" via queryMultiAdapter instead of looking into
Christian Zagrodnick
cz at gocept.com
Thu Oct 8 07:35:22 EDT 2009
Log message for revision 104919:
- Look up the "resources view" via queryMultiAdapter instead of looking into
the adapter registry.
Changed:
U zc.resourcelibrary/trunk/CHANGES.txt
U zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
-=-
Modified: zc.resourcelibrary/trunk/CHANGES.txt
===================================================================
--- zc.resourcelibrary/trunk/CHANGES.txt 2009-10-08 10:48:59 UTC (rev 104918)
+++ zc.resourcelibrary/trunk/CHANGES.txt 2009-10-08 11:35:22 UTC (rev 104919)
@@ -8,7 +8,10 @@
- Use ``zope.browserresource`` instead of ``zope.app.publisher``, removing
a dependency on latter.
+- Look up the "resources view" via queryMultiAdapter instead of looking into
+ the adapter registry.
+
1.2.0 (2009-06-04)
------------------
Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py 2009-10-08 10:48:59 UTC (rev 104918)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py 2009-10-08 11:35:22 UTC (rev 104919)
@@ -103,15 +103,11 @@
site = getSite()
if site is None:
return
-
- # look up resources view factory
- factory = getSiteManager().adapters.lookup(
- (ISite, interface.providedBy(self._request)),
- interface.Interface, name="")
- if IBrowserPublisher.implementedBy(factory):
- resources = factory(site, self._request)
- else:
+ resources = queryMultiAdapter(
+ (site, self._request), interface.Interface, name='')
+
+ if not IBrowserPublisher.providedBy(resources):
# a setup with no resources factory is supported; in this
# case, we manually craft a URL to the resource publisher
# (see ``zope.browserresource.resource``).
More information about the checkins
mailing list