comparison idavoll/memory_backend.py @ 40:b9e7b3b6c687

Moved get_supported_affiliations() to super class. Use string instead of JID in call to store_items().
author Ralph Meijer <ralphm@ik.nu>
date Sun, 31 Oct 2004 21:08:40 +0000
parents 9aa20efac203
children 9685b7e291ef
comparison
equal deleted inserted replaced
39:788114f9b5bc 40:b9e7b3b6c687
34 node.affiliations["ralphm@doe.ik.nu"] = "publisher" 34 node.affiliations["ralphm@doe.ik.nu"] = "publisher"
35 node.configuration.persist_items = True 35 node.configuration.persist_items = True
36 node.configuration.deliver_payloads = True 36 node.configuration.deliver_payloads = True
37 self.nodes[node.id] = node 37 self.nodes[node.id] = node
38 38
39 def get_supported_affiliations(self):
40 return ['none', 'owner', 'outcast', 'publisher']
41
42 def create_node(self, node_id, requestor): 39 def create_node(self, node_id, requestor):
43 if not node_id: 40 if not node_id:
44 raise backend.NoInstantNodes 41 raise backend.NoInstantNodes
45 42
46 if node_id in self.nodes: 43 if node_id in self.nodes:
78 for item in items: 75 for item in items:
79 if item["id"] is None: 76 if item["id"] is None:
80 item["id"] = 'random' # FIXME 77 item["id"] = 'random' # FIXME
81 78
82 if persist_items: 79 if persist_items:
83 self.store_items(node_id, items, requestor) 80 self.store_items(node_id, items, requestor.full())
84 81
85 if items and not deliver_payloads: 82 if items and not deliver_payloads:
86 for item in items: 83 for item in items:
87 item.children = [] 84 item.children = []
88 85