annotate idavoll/idavoll.py @ 73:5d7a924ebddb

Reworked disco support. Actually return disco items.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 07 Nov 2004 14:21:09 +0000
parents cdf17c4d3bf9
children 1f7b8b6b8ce9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
1 from twisted.protocols.jabber import component
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
2 from twisted.application import service
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
3 from twisted.python import components
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
4 from twisted.internet import defer
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
5 import backend
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
6 import pubsub
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
7 import xmpp_error
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
8 import disco
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
9
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
10 import sys
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
11
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
12 NS_VERSION = 'jabber:iq:version'
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
13
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
14 IQ_GET = '/iq[@type="get"]'
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
15 IQ_SET = '/iq[@type="set"]'
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
16 VERSION = IQ_GET + '/query[@xmlns="' + NS_VERSION + '"]'
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
17 DISCO_INFO = IQ_GET + '/query[@xmlns="' + disco.NS_INFO + '"]'
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
18 DISCO_ITEMS = IQ_GET + '/query[@xmlns="' + disco.NS_ITEMS + '"]'
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
19
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
20 class IdavollService(component.Service):
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
21
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
22 def componentConnected(self, xmlstream):
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
23 self.xmlstream = xmlstream
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
24 xmlstream.addObserver(VERSION, self.onVersion, 1)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
25 xmlstream.addObserver(DISCO_INFO, self.onDiscoInfo, 1)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
26 xmlstream.addObserver(DISCO_ITEMS, self.onDiscoItems, 1)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
27 xmlstream.addObserver(IQ_GET, self.iqFallback, -1)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
28 xmlstream.addObserver(IQ_SET, self.iqFallback, -1)
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
29
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
30 def get_disco_info(self, node):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
31 info = []
57
445a61f872b6 Use NodeCreationService for pgsql backend, too.
Ralph Meijer <ralphm@ik.nu>
parents: 52
diff changeset
32
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
33 if not node:
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
34 info.append(disco.Feature(disco.NS_ITEMS))
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
35 info.append(disco.Feature(NS_VERSION))
57
445a61f872b6 Use NodeCreationService for pgsql backend, too.
Ralph Meijer <ralphm@ik.nu>
parents: 52
diff changeset
36
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
37 return defer.succeed(info)
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
38
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
39 def onVersion(self, iq):
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
40 iq.swapAttributeValues("to", "from")
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
41 iq["type"] = "result"
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
42 name = iq.addElement("name", None, 'Idavoll')
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
43 version = iq.addElement("version", None, '0.1')
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
44 self.send(iq)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
45 iq.handled = True
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
46
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
47 def onDiscoInfo(self, iq):
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
48 dl = []
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
49 node = iq.query.getAttribute("node")
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
50
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
51 for c in self.parent:
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
52 if components.implements(c, component.IService):
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
53 if hasattr(c, "get_disco_info"):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
54 dl.append(c.get_disco_info(node))
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
55 d = defer.DeferredList(dl, fireOnOneErrback=1)
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
56 d.addCallback(self._disco_info_results, iq, node)
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
57 d.addErrback(self._error, iq)
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
58 d.addCallback(self.send)
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
59
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
60 iq.handled = True
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
61
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
62 def _disco_info_results(self, results, iq, node):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
63 info = []
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
64 for i in results:
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
65 info.extend(i[1])
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
66
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
67 if node and not info:
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
68 return xmpp_error.error_from_iq(iq, 'item-not-found')
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
69 else:
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
70 iq.swapAttributeValues("to", "from")
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
71 iq["type"] = "result"
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
72 iq.query.children = info
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
73
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
74 return iq
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
75
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
76 def _error(self, results, iq):
67
cdf17c4d3bf9 Made returning disco info use deferreds.
Ralph Meijer <ralphm@ik.nu>
parents: 63
diff changeset
77 return xmpp_error.error_from_iq(iq, 'internal-error')
8
688992a789e4 Add disco support
Ralph Meijer <ralphm@ik.nu>
parents: 1
diff changeset
78
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
79 def onDiscoItems(self, iq):
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
80 dl = []
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
81 node = iq.query.getAttribute("node")
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
82
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
83 for c in self.parent:
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
84 if components.implements(c, component.IService):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
85 if hasattr(c, "get_disco_items"):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
86 dl.append(c.get_disco_items(node))
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
87 d = defer.DeferredList(dl, fireOnOneErrback=1)
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
88 d.addCallback(self._disco_items_result, iq, node)
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
89 d.addErrback(self._error, iq)
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
90 d.addCallback(self.send)
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
91
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
92 iq.handled = True
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
93
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
94 def _disco_items_result(self, results, iq, node):
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
95 items = []
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
96
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
97 for i in results:
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
98 items.extend(i[1])
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
99
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
100 iq.swapAttributeValues("to", "from")
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
101 iq["type"] = "result"
73
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
102 iq.query.children = items
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
103
5d7a924ebddb Reworked disco support.
Ralph Meijer <ralphm@ik.nu>
parents: 67
diff changeset
104 return iq
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
105
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
106 def iqFallback(self, iq):
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
107 if iq.handled == True:
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
108 return
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
109
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
110 self.send(xmpp_error.error_from_iq(iq, 'service-unavailable'))
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
111
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
112 def makeService(config):
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
113 serviceCollection = service.MultiService()
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
114
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
115 # set up Jabber Component
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
116 sm = component.buildServiceManager(config["jid"], config["secret"],
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
117 ("tcp:%s:%s" % (config["rhost"], config["rport"])))
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
118
42
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
119 if config['backend'] == 'pgsql':
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
120 import pgsql_backend as b
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
121 st = b.Storage(user=config['dbuser'], database=config['dbname'])
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
122 elif config['backend'] == 'memory':
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
123 import memory_backend as b
43
9685b7e291ef Moved common stuff out of pgsql_backend.py to backend.py.
Ralph Meijer <ralphm@ik.nu>
parents: 42
diff changeset
124 st = b.Storage()
42
7d088c61e131 Make choice of backend an option to mktap. This includes the database
Ralph Meijer <ralphm@ik.nu>
parents: 35
diff changeset
125
43
9685b7e291ef Moved common stuff out of pgsql_backend.py to backend.py.
Ralph Meijer <ralphm@ik.nu>
parents: 42
diff changeset
126 bs = b.BackendService(st)
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
127
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
128 component.IService(bs).setServiceParent(sm)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
129
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
130 bsc = b.PublishService()
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
131 bsc.setServiceParent(bs)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
132 component.IService(bsc).setServiceParent(sm)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
133
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
134 bsc = b.NotificationService()
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
135 bsc.setServiceParent(bs)
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
136 component.IService(bsc).setServiceParent(sm)
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
137
52
0947b46c0968 Use ISubscriptionService support of PostgreSQL backend.
Ralph Meijer <ralphm@ik.nu>
parents: 43
diff changeset
138 bsc = b.SubscriptionService()
0947b46c0968 Use ISubscriptionService support of PostgreSQL backend.
Ralph Meijer <ralphm@ik.nu>
parents: 43
diff changeset
139 bsc.setServiceParent(bs)
0947b46c0968 Use ISubscriptionService support of PostgreSQL backend.
Ralph Meijer <ralphm@ik.nu>
parents: 43
diff changeset
140 component.IService(bsc).setServiceParent(sm)
0947b46c0968 Use ISubscriptionService support of PostgreSQL backend.
Ralph Meijer <ralphm@ik.nu>
parents: 43
diff changeset
141
57
445a61f872b6 Use NodeCreationService for pgsql backend, too.
Ralph Meijer <ralphm@ik.nu>
parents: 52
diff changeset
142 bsc = b.NodeCreationService()
445a61f872b6 Use NodeCreationService for pgsql backend, too.
Ralph Meijer <ralphm@ik.nu>
parents: 52
diff changeset
143 bsc.setServiceParent(bs)
445a61f872b6 Use NodeCreationService for pgsql backend, too.
Ralph Meijer <ralphm@ik.nu>
parents: 52
diff changeset
144 component.IService(bsc).setServiceParent(sm)
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
145
63
60e95c60252d Setup AffiliationsService and matching protocol adapter for the pgsql
Ralph Meijer <ralphm@ik.nu>
parents: 57
diff changeset
146 if config['backend'] == 'pgsql':
60e95c60252d Setup AffiliationsService and matching protocol adapter for the pgsql
Ralph Meijer <ralphm@ik.nu>
parents: 57
diff changeset
147 bsc = b.AffiliationsService()
60e95c60252d Setup AffiliationsService and matching protocol adapter for the pgsql
Ralph Meijer <ralphm@ik.nu>
parents: 57
diff changeset
148 bsc.setServiceParent(bs)
60e95c60252d Setup AffiliationsService and matching protocol adapter for the pgsql
Ralph Meijer <ralphm@ik.nu>
parents: 57
diff changeset
149 component.IService(bsc).setServiceParent(sm)
60e95c60252d Setup AffiliationsService and matching protocol adapter for the pgsql
Ralph Meijer <ralphm@ik.nu>
parents: 57
diff changeset
150
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
151 s = IdavollService()
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
152 s.setServiceParent(sm)
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
153
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
154 sm.setServiceParent(serviceCollection)
1
4cc41776b7d7 Initial revision
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
155
32
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
156 # other stuff
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
157
ddc08757ec1d Fire up several component.IServices that match the backend Services.
Ralph Meijer <ralphm@ik.nu>
parents: 26
diff changeset
158 return sm