changeset 98:b9c449f4c167

Removed debugging junk
author Ralph Meijer <ralphm@ik.nu>
date Wed, 24 Nov 2004 20:08:28 +0000
parents cf918d581da5
children 886caecb0030
files idavoll/backend.py idavoll/pgsql_backend.py idavoll/pubsub.py
diffstat 3 files changed, 17 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/backend.py	Tue Nov 23 17:05:21 2004 +0000
+++ b/idavoll/backend.py	Wed Nov 24 20:08:28 2004 +0000
@@ -217,8 +217,6 @@
         elif not items and (persist_items or deliver_payloads):
             raise PayloadExpected
 
-        print "publish by %s to %s" % (requestor.full(), node_id)
-
         if persist_items or deliver_payloads:
             for item in items:
                 if not item.getAttribute("id"):
@@ -412,18 +410,11 @@
         return d
 
     def _do_get_items(self, result, node_id, max_items, item_ids):
-        def q(r):
-            print r
-            return r
-
         if not result:
             raise NotAuthorized
 
         if item_ids:
-            d = self.parent.storage.get_items_by_ids(node_id, item_ids)
-            d.addCallback(q)
-            d.addErrback(q)
-            return d
+            return self.parent.storage.get_items_by_ids(node_id, item_ids)
         else:
             return self.parent.storage.get_items(node_id, max_items)
 
--- a/idavoll/pgsql_backend.py	Tue Nov 23 17:05:21 2004 +0000
+++ b/idavoll/pgsql_backend.py	Wed Nov 24 20:08:28 2004 +0000
@@ -177,17 +177,14 @@
             cursor.execute("""INSERT INTO entities (jid) VALUES (%s)""",
                            (owner.full().encode('utf8')))
 
-        try:
-            cursor.execute("""INSERT INTO affiliations
-                              (node_id, entity_id, affiliation)
-                              SELECT n.id, e.id, 'owner' FROM
-                              (SELECT id FROM nodes WHERE node=%s) AS n
-                              CROSS JOIN
-                              (SELECT id FROM entities WHERE jid=%s) AS e""",
-                           (node_id.encode('utf8'),
-                            owner.full().encode('utf8')))
-        except Exception, e:
-            print e
+        cursor.execute("""INSERT INTO affiliations
+                          (node_id, entity_id, affiliation)
+                          SELECT n.id, e.id, 'owner' FROM
+                          (SELECT id FROM nodes WHERE node=%s) AS n
+                          CROSS JOIN
+                          (SELECT id FROM entities WHERE jid=%s) AS e""",
+                       (node_id.encode('utf8'),
+                        owner.full().encode('utf8')))
 
         return None
 
@@ -276,15 +273,12 @@
         query = """SELECT data FROM nodes JOIN items ON
                    (nodes.id=items.node_id)
                    WHERE node=%s ORDER BY date DESC"""
-        try:
-            if max_items:
-                cursor.execute(query + " LIMIT %s",
-                               (node_id.encode('utf8'),
-                                max_items))
-            else:
-                cursor.execute(query, (node_id.encode('utf8')))
-        except Exception, e:
-            print e
+        if max_items:
+            cursor.execute(query + " LIMIT %s",
+                           (node_id.encode('utf8'),
+                            max_items))
+        else:
+            cursor.execute(query, (node_id.encode('utf8')))
 
         result = cursor.fetchall()
         return [r[0] for r in result]
--- a/idavoll/pubsub.py	Tue Nov 23 17:05:21 2004 +0000
+++ b/idavoll/pubsub.py	Wed Nov 24 20:08:28 2004 +0000
@@ -167,7 +167,6 @@
         d.addCallback(self._notify, node_id)
 
     def _notify(self, list, node_id):
-        print list
         for recipient, items in list.items():
             self._notify_recipient(recipient, node_id, items)
 
@@ -207,8 +206,6 @@
             if child.__class__ == domish.Element and child.name == 'item':
                 items.append(child)
 
-        print items
-
         return self.backend.publish(node, items,
                                     jid.JID(iq["from"]).userhostJID())
 
@@ -395,7 +392,6 @@
             if element.name == 'field' and element.uri == NS_X_DATA:
                 options[element["var"]] = str(element.value)
 
-        print options
         return options
 
 components.registerAdapter(ComponentServiceFromNodeCreationService, backend.INodeCreationService, component.IService)
@@ -473,11 +469,8 @@
         reply = domish.Element((NS_PUBSUB, 'pubsub'))
         items = reply.addElement('items')
         items["node"] = node_id
-        try:
-            for r in result:
-                items.addRawXml(r)
-        except Exception, e:
-            print e
+        for r in result:
+            items.addRawXml(r)
 
         return [reply]
 
@@ -514,8 +507,6 @@
                 except KeyError:
                     raise BadRequest
 
-        print item_ids
-
         return self.backend.retract_item(node, item_ids,
                                     jid.JID(iq["from"]).userhostJID())
 
@@ -560,7 +551,6 @@
 
         for subscriber in subscribers:
             message["to"] = subscriber
-            print message.toXml()
             self.send(message)
 
     def onDelete(self, iq):