# HG changeset patch # User Ralph Meijer # Date 1101326908 0 # Node ID b9c449f4c167c6e0b307869ca25b991ccd3e4e1a # Parent cf918d581da5aa239a967e5431cafd303ee38baa Removed debugging junk diff -r cf918d581da5 -r b9c449f4c167 idavoll/backend.py --- 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) diff -r cf918d581da5 -r b9c449f4c167 idavoll/pgsql_backend.py --- 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] diff -r cf918d581da5 -r b9c449f4c167 idavoll/pubsub.py --- 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):