comparison sat_pubsub/pgsql_storage.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 1167e48e5f52
children 9fbb31ce495b
comparison
equal deleted inserted replaced
363:a98b3d52c2ff 364:8bd8be6815ab
81 def withPEP(query, values, pep, recipient): 81 def withPEP(query, values, pep, recipient):
82 """Helper method to facilitate PEP management 82 """Helper method to facilitate PEP management
83 83
84 @param query: SQL query basis 84 @param query: SQL query basis
85 @param values: current values to replace in query 85 @param values: current values to replace in query
86 @param pep: True if we are in PEP mode 86 @param pep(bool): True if we are in PEP mode
87 @param recipient: jid of the recipient 87 @param recipient(jid.JID): jid of the recipient
88 @return: query + PEP AND check, 88 @return: query + PEP AND check,
89 recipient's bare jid is added to value if needed 89 recipient's bare jid is added to value if needed
90 """ 90 """
91 if pep: 91 if pep:
92 pep_check="AND {}=%s".format(PEP_COL_NAME) 92 pep_check="AND {}=%s".format(PEP_COL_NAME)
211 return self._buildNode(row) 211 return self._buildNode(row)
212 212
213 def getNodeIds(self, pep, recipient, allowed_accesses=None): 213 def getNodeIds(self, pep, recipient, allowed_accesses=None):
214 """retrieve ids of existing nodes 214 """retrieve ids of existing nodes
215 215
216 @param pep(bool): True if it's a PEP request
217 @param recipient(jid.JID, None): recipient of the PEP request
216 @param allowed_accesses(None, set): only nodes with access 218 @param allowed_accesses(None, set): only nodes with access
217 in this set will be returned 219 in this set will be returned
218 None to return all nodes 220 None to return all nodes
219 @return (list[unicode]): ids of nodes 221 @return (list[unicode]): ids of nodes
220 """ 222 """