diff sat_pubsub/backend.py @ 364:8bd8be6815ab

completed docstrings + use short notation for sets
author Arnaud Joset <info@agayon.be>
date Fri, 03 Nov 2017 13:59:54 +0100
parents a98b3d52c2ff
children 9fbb31ce495b
line wrap: on
line diff
--- a/sat_pubsub/backend.py	Fri Nov 03 13:59:15 2017 +0100
+++ b/sat_pubsub/backend.py	Fri Nov 03 13:59:54 2017 +0100
@@ -276,7 +276,7 @@
     def parseCategories(self, item_elt):
         """Check if item contain an atom entry, and parse categories if possible
 
-        @param item (domish.Element): item to parse
+        @param item_elt (domish.Element): item to parse
         @return (list): list of found categories
         """
         categories = []
@@ -538,6 +538,8 @@
         @param requestor(jid.JID): entity who want to check subscriptions
         @param nodeIdentifier(unicode, None): identifier of the node
             node to get all subscriptions of a service
+        @param pep(bool): True if it's a PEP request
+        @param recipient(jid.JID, None): recipient of the PEP request
         """
         return self.storage.getSubscriptions(requestor, nodeIdentifier, pep, recipient)
 
@@ -627,6 +629,9 @@
         @param nodeIdentifier(unicode): identifier of the pubusb node
         @param schema(domish.Element, None): schema to set
             None to remove schema
+        @param requestor(jid.JID): entity doing the request
+        @param pep(bool): True if it's a PEP request
+        @param recipient(jid.JID, None): recipient of the PEP request
         """
         if not nodeIdentifier:
             return defer.fail(error.NoRootNode())
@@ -1262,6 +1267,7 @@
         if self.backend.supportsGroupBlog():
             self.features.append("groupblog")
 
+
         # if self.backend.supportsPublishModel():       #XXX: this feature is not really described in XEP-0060, we just can see it in examples
         #     self.features.append("publish_model")     #     but it's necessary for microblogging comments (see XEP-0277)
 
@@ -1295,9 +1301,9 @@
         for owner_jid in owners:
             notifications_filtered.append(
                 (owner_jid,
-                 set([pubsub.Subscription(node.nodeIdentifier,
-                                          owner_jid,
-                                          'subscribed')]),
+                 {pubsub.Subscription(node.nodeIdentifier,
+                                      owner_jid,
+                                      'subscribed')},
                  [self.getFullItem(item_data) for item_data in items_data]))
 
         if pep:
@@ -1325,9 +1331,9 @@
             for owner_jid in owners:
                 notifications_filtered.append(
                     (owner_jid,
-                     set([pubsub.Subscription(node.nodeIdentifier,
-                                              owner_jid,
-                                              'subscribed')]),
+                     {pubsub.Subscription(node.nodeIdentifier,
+                                          owner_jid,
+                                          'subscribed')},
                      [item_data.item for item_data in items_data]))
 
             if pep: