[Zope3-checkins] CVS: Zope3/src/zope/app/services/translation - messagecatalog.py:1.5

Jim Fulton jim@zope.com
Fri, 18 Apr 2003 18:12:59 -0400


Update of /cvs-repository/Zope3/src/zope/app/services/translation
In directory cvs.zope.org:/tmp/cvs-serv8556/src/zope/app/services/translation

Modified Files:
	messagecatalog.py 
Log Message:
In prepration for the upcoming interface changes, I added some
new functions for making interface assertions on instances.  

Rather than:

  class C:

     __class_implements__ = I1, I2

use:

  class C:

     classProvides(I1, I2)

rather than:

__implements__ = I1, I2

use:

moduleProvides(I1, I2)

rather than:

someinstance.__implements__ = I1, I2

use:

directlyProvides(I1, I2)

Note that interface assertions on persistent objects should be aboided
since the internal representation will change.

Continue to make assertions about the interfaces that class instances
implement the same way:

  class C:

     __implements__ = I1, I2


I also modified the core software to use the new spellings.



=== Zope3/src/zope/app/services/translation/messagecatalog.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/translation/messagecatalog.py:1.4	Tue Mar 25 18:25:12 2003
+++ Zope3/src/zope/app/services/translation/messagecatalog.py	Fri Apr 18 18:12:29 2003
@@ -15,6 +15,7 @@
 
 $Id$
 """
+from zope.interface import classProvides
 import time
 
 from zodb.btrees.OOBTree import OOBTree
@@ -28,7 +29,7 @@
 class MessageCatalog(RegisteredObject, Persistent):
 
     __implements__ =  ILocalMessageCatalog
-    __class_implements__ = IFactory
+    classProvides(IFactory)
 
     def __init__(self, language, domain="default"):
         """Initialize the message catalog"""