[Zope3-checkins] CVS: Zope3/src/zope/app/wiki - wikipage.py:1.6

Jim Fulton jim at zope.com
Sat Mar 6 11:51:05 EST 2004


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

Modified Files:
	wikipage.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/wiki/wikipage.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/wiki/wikipage.py:1.5	Fri Mar  5 17:09:22 2004
+++ Zope3/src/zope/app/wiki/wikipage.py	Sat Mar  6 11:50:35 2004
@@ -62,7 +62,7 @@
 
     def __init__(self, context):
         self.context = context
-        self._annotations = zapi.getAdapter(context, IAnnotations)
+        self._annotations = IAnnotations(context)
         if not self._annotations.get(HierarchyKey):
             self._annotations[HierarchyKey] = ()
 
@@ -85,7 +85,7 @@
             return [self.context]
         wiki = zapi.getParent(self.context)
         name = self.getParents()[0]
-        hier = zapi.getAdapter(wiki[name], IWikiPageHierarchy)
+        hier = IWikiPageHierarchy(wiki[name])
         return hier.path() + [self.context]
 
     def findChildren(self, recursive=True):
@@ -94,7 +94,7 @@
         contextName = zapi.name(self.context)
         children = []
         for pageName in wiki:
-            hier = zapi.getAdapter(wiki[pageName], IWikiPageHierarchy)
+            hier = IWikiPageHierarchy(wiki[pageName])
             if contextName in hier.getParents():
                 if recursive:
                     subs = hier.findChildren()
@@ -122,11 +122,11 @@
 
     # See zope.app.wiki.interfaces.IComment
     def _getTitle(self):
-        dc = zapi.getAdapter(self, ICMFDublinCore)
+        dc = ICMFDublinCore(self)
         return dc.title
 
     def _setTitle(self, title):
-        dc = zapi.getAdapter(self, ICMFDublinCore)
+        dc = ICMFDublinCore(self)
         dc.title = title
 
     title = property(_getTitle, _setTitle)
@@ -177,7 +177,7 @@
 
     def __init__(self, context):
         self.context = context
-        self._annotations = zapi.getAdapter(context, IAnnotations)
+        self._annotations = IAnnotations(context)
         if not self._annotations.get(SubscriberKey):
             self._annotations[SubscriberKey] = ()
 
@@ -249,10 +249,9 @@
     def getAllSubscribers(self, object):
         """Retrieves all email subscribers by looking into the local Wiki Page
            and into the Wiki for the global subscriptions."""
-        emails = tuple(zapi.getAdapter(object,
-                                  IMailSubscriptions).getSubscriptions())
-        emails += tuple(zapi.getAdapter(zapi.getParent(object),
-                                   IMailSubscriptions).getSubscriptions())
+        emails = tuple(IMailSubscriptions(object).getSubscriptions())
+        emails += tuple(IMailSubscriptions(zapi.getParent(object)
+                                           ).getSubscriptions())
         return emails
 
     def mail(self, emails, subject, body):




More information about the Zope3-Checkins mailing list