comparison idavoll/idavoll.py @ 109:9fb8f0867d02

Use storage.
author Ralph Meijer <ralphm@ik.nu>
date Fri, 08 Apr 2005 10:16:53 +0000
parents 8d8946e67fcb
children 3d77f3808bfa
comparison
equal deleted inserted replaced
108:1c18759d2afb 109:9fb8f0867d02
137 137
138 if config["verbose"]: 138 if config["verbose"]:
139 LogService().setServiceParent(sm) 139 LogService().setServiceParent(sm)
140 140
141 if config['backend'] == 'pgsql': 141 if config['backend'] == 'pgsql':
142 import pgsql_backend as b 142 import pgsql_storage
143 st = b.Storage(user=config['dbuser'], database=config['dbname']) 143 st = pgsql_storage.Storage(user=config['dbuser'],
144 database=config['dbname'])
144 elif config['backend'] == 'memory': 145 elif config['backend'] == 'memory':
145 import memory_backend as b 146 import memory_storage
146 st = b.Storage() 147 st = memory_storage.Storage()
147 148
149 import generic_backend as b
148 bs = b.BackendService(st) 150 bs = b.BackendService(st)
149 151
150 c = component.IService(bs) 152 c = component.IService(bs)
151 c.setServiceParent(sm) 153 c.setServiceParent(sm)
152 c.hide_nodes = config["hide-nodes"] 154 c.hide_nodes = config["hide-nodes"]
169 171
170 bsc = b.AffiliationsService() 172 bsc = b.AffiliationsService()
171 bsc.setServiceParent(bs) 173 bsc.setServiceParent(bs)
172 component.IService(bsc).setServiceParent(sm) 174 component.IService(bsc).setServiceParent(sm)
173 175
174 if config['backend'] == 'pgsql': 176 bsc = b.ItemRetrievalService()
175 bsc = b.ItemRetrievalService() 177 bsc.setServiceParent(bs)
176 bsc.setServiceParent(bs) 178 component.IService(bsc).setServiceParent(sm)
177 component.IService(bsc).setServiceParent(sm)
178 179
179 bsc = b.RetractionService() 180 bsc = b.RetractionService()
180 bsc.setServiceParent(bs) 181 bsc.setServiceParent(bs)
181 component.IService(bsc).setServiceParent(sm) 182 component.IService(bsc).setServiceParent(sm)
182 183
183 bsc = b.NodeDeletionService() 184 bsc = b.NodeDeletionService()
184 bsc.setServiceParent(bs) 185 bsc.setServiceParent(bs)
185 component.IService(bsc).setServiceParent(sm) 186 component.IService(bsc).setServiceParent(sm)
186 187
187 s = IdavollService() 188 s = IdavollService()
188 s.setServiceParent(sm) 189 s.setServiceParent(sm)
189 190
190 sm.setServiceParent(serviceCollection) 191 sm.setServiceParent(serviceCollection)