changeset 105:8d8946e67fcb

Move to Twisted 2.0.
author Ralph Meijer <ralphm@ik.nu>
date Fri, 08 Apr 2005 10:01:40 +0000
parents d42327839888
children dc36882d2620
files idavoll/backend.py idavoll/idavoll.py idavoll/memory_backend.py idavoll/pgsql_backend.py idavoll/pubsub.py
diffstat 5 files changed, 19 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/backend.py	Fri Apr 08 09:54:41 2005 +0000
+++ b/idavoll/backend.py	Fri Apr 08 10:01:40 2005 +0000
@@ -1,8 +1,9 @@
-from twisted.protocols.jabber import jid
+from twisted.words.protocols.jabber import jid
 from twisted.python import components
 from twisted.application import service
 from twisted.xish import utility
 from twisted.internet import defer
+from zope.interface import implements
 import sha
 import time
 
@@ -169,7 +170,7 @@
 
 class BackendService(service.MultiService, utility.EventDispatcher):
 
-    __implements__ = IBackendService,
+    implements(IBackendService)
 
     options = {"pubsub#persist_items":
                   {"type": "boolean",
@@ -222,7 +223,7 @@
 
 class PublishService(service.Service):
     
-    __implements__ = IPublishService,
+    implements(IPublishService)
 
     def publish(self, node_id, items, requestor):
         d1 = self.parent.storage.get_node_configuration(node_id)
@@ -270,7 +271,7 @@
 
 class NotificationService(service.Service):
 
-    __implements__ = INotificationService,
+    implements(INotificationService)
 
     def get_notification_list(self, node_id, items):
         d = self.parent.storage.get_subscribers(node_id)
@@ -289,7 +290,7 @@
 
 class SubscriptionService(service.Service):
 
-    __implements__ = ISubscriptionService,
+    implements(ISubscriptionService)
 
     def subscribe(self, node_id, subscriber, requestor):
         if subscriber.userhostJID() != requestor:
@@ -332,7 +333,7 @@
 
 class NodeCreationService(service.Service):
 
-    __implements__ = INodeCreationService,
+    implements(INodeCreationService)
 
     def supports_instant_nodes(self):
         return True
@@ -384,7 +385,7 @@
 
 class AffiliationsService(service.Service):
 
-    __implements__ = IAffiliationsService,
+    implements(IAffiliationsService)
 
     def get_affiliations(self, entity):
         d1 = self.parent.storage.get_affiliations(entity)
@@ -421,7 +422,7 @@
 
 class ItemRetrievalService(service.Service):
 
-    __implements__ = IItemRetrievalService
+    implements(IItemRetrievalService)
 
     def get_items(self, node_id, requestor, max_items=None, item_ids=[]):
         d = self.parent.storage.is_subscribed(node_id, requestor)
@@ -439,7 +440,7 @@
 
 class RetractionService(service.Service):
 
-    __implements__ = IRetractionService,
+    implements(IRetractionService)
                                                                                 
     def retract_item(self, node_id, item_ids, requestor):
         d1 = self.parent.storage.get_node_configuration(node_id)
@@ -496,7 +497,7 @@
 
 class NodeDeletionService(service.Service):
 
-    __implements__ = INodeDeletionService,
+    implements(INodeDeletionService)
 
     def __init__(self):
         self._callback_list = []
--- a/idavoll/idavoll.py	Fri Apr 08 09:54:41 2005 +0000
+++ b/idavoll/idavoll.py	Fri Apr 08 10:01:40 2005 +0000
@@ -1,4 +1,4 @@
-from twisted.protocols.jabber import component
+from twisted.words.protocols.jabber import component
 from twisted.application import service
 from twisted.python import components
 from twisted.internet import defer
@@ -49,7 +49,7 @@
         node = iq.query.getAttribute("node")
 
         for c in self.parent:
-            if components.implements(c, component.IService):
+            if component.IService.providedBy(c):
                 if hasattr(c, "get_disco_info"):
                     dl.append(c.get_disco_info(node))
         d = defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=1)
@@ -88,7 +88,7 @@
         node = iq.query.getAttribute("node")
 
         for c in self.parent:
-            if components.implements(c, component.IService):
+            if component.IService.providedBy(c):
                 if hasattr(c, "get_disco_items"):
                     dl.append(c.get_disco_items(node))
         d = defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=1)
--- a/idavoll/memory_backend.py	Fri Apr 08 09:54:41 2005 +0000
+++ b/idavoll/memory_backend.py	Fri Apr 08 10:01:40 2005 +0000
@@ -1,6 +1,6 @@
 from twisted.application import service
 from twisted.internet import defer
-from twisted.protocols.jabber import jid
+from twisted.words.protocols.jabber import jid
 import backend
 
 class Subscription:
--- a/idavoll/pgsql_backend.py	Fri Apr 08 09:54:41 2005 +0000
+++ b/idavoll/pgsql_backend.py	Fri Apr 08 10:01:40 2005 +0000
@@ -1,6 +1,6 @@
 from twisted.application import service
 from twisted.internet import defer
-from twisted.protocols.jabber import jid
+from twisted.words.protocols.jabber import jid
 from twisted.enterprise import adbapi
 import backend
 
--- a/idavoll/pubsub.py	Fri Apr 08 09:54:41 2005 +0000
+++ b/idavoll/pubsub.py	Fri Apr 08 10:01:40 2005 +0000
@@ -1,7 +1,8 @@
-from twisted.protocols.jabber import component,jid
+from twisted.words.protocols.jabber import component,jid
 from twisted.xish import utility, domish
 from twisted.python import components
 from twisted.internet import defer
+from zope.interface import implements
 
 import backend
 import xmpp_error
@@ -68,7 +69,7 @@
 
 class Service(component.Service):
 
-    __implements__ = component.IService
+    implements(component.IService)
 
     def __init__(self, backend):
         self.backend = backend