[Zope3-checkins] CVS: Zope3/src/zope/app/catalog - catalog.py:1.13

Anthony Baxter anthony at interlink.com.au
Sun Feb 8 20:12:55 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/catalog
In directory cvs.zope.org:/tmp/cvs-serv5872/src/zope/app/catalog

Modified Files:
	catalog.py 
Log Message:
implements hackery to make ICatalog the most specific interface for 
CatalogUtility. This makes the Utility add screen default to the 
correct interface.


=== Zope3/src/zope/app/catalog/catalog.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/catalog/catalog.py:1.12	Mon Nov  3 16:38:00 2003
+++ Zope3/src/zope/app/catalog/catalog.py	Sun Feb  8 20:12:55 2004
@@ -1,6 +1,6 @@
 from persistence import Persistent
 from persistence.dict import PersistentDict
-from zope.interface import implements
+from zope.interface import implements, implementsOnly, implementedBy
 from zope.app.zapi import getService, getAdapter
 from zope.app.services.servicenames import HubIds
 from zope.exceptions import NotFoundError
@@ -130,7 +130,11 @@
 
 class CatalogUtility(CatalogBase):
     "A Catalog in service-space"
-    implements (ILocalUtility)
+    # Utilities will default to implementing the most specific 
+    # interface. This piece of delightfulness is needed because
+    # the interface resolution order machinery implements (no
+    # pun intended) the old-style Python resolution order machinery.
+    implementsOnly(implementedBy(CatalogBase), ILocalUtility)
 
 class Catalog(CatalogBase): 
     "A content-space Catalog"




More information about the Zope3-Checkins mailing list