equal
deleted
inserted
replaced
188 self.fill_schema() |
188 self.fill_schema() |
189 elif config.bootstrap_schema: |
189 elif config.bootstrap_schema: |
190 # usually during repository creation |
190 # usually during repository creation |
191 self.warning("set fs instance'schema as bootstrap schema") |
191 self.warning("set fs instance'schema as bootstrap schema") |
192 config.bootstrap_cubes() |
192 config.bootstrap_cubes() |
193 self.set_bootstrap_schema(self.config.load_schema()) |
193 self.set_bootstrap_schema(config.load_schema()) |
194 # need to load the Any and CWUser entity types |
194 # need to load the Any and CWUser entity types |
195 self.vreg.schema = self.schema |
195 self.vreg.schema = self.schema |
196 etdirectory = join(CW_SOFTWARE_ROOT, 'entities') |
196 etdirectory = join(CW_SOFTWARE_ROOT, 'entities') |
197 self.vreg.init_registration([etdirectory]) |
197 self.vreg.init_registration([etdirectory]) |
198 self.vreg.load_file(join(etdirectory, '__init__.py'), |
198 self.vreg.load_file(join(etdirectory, '__init__.py'), |
201 'cubicweb.entities.authobjs') |
201 'cubicweb.entities.authobjs') |
202 else: |
202 else: |
203 # test start: use the file system schema (quicker) |
203 # test start: use the file system schema (quicker) |
204 self.warning("set fs instance'schema") |
204 self.warning("set fs instance'schema") |
205 config.bootstrap_cubes() |
205 config.bootstrap_cubes() |
206 self.set_schema(self.config.load_schema()) |
206 self.set_schema(config.load_schema()) |
207 if not config.creating: |
207 if not config.creating: |
208 if 'CWProperty' in self.schema: |
208 if 'CWProperty' in self.schema: |
209 self.vreg.init_properties(self.properties()) |
209 self.vreg.init_properties(self.properties()) |
210 # call source's init method to complete their initialisation if |
210 # call source's init method to complete their initialisation if |
211 # needed (for instance looking for persistent configuration using an |
211 # needed (for instance looking for persistent configuration using an |
229 self._shutting_down = False |
229 self._shutting_down = False |
230 if not (config.creating or config.repairing): |
230 if not (config.creating or config.repairing): |
231 # call instance level initialisation hooks |
231 # call instance level initialisation hooks |
232 self.hm.call_hooks('server_startup', repo=self) |
232 self.hm.call_hooks('server_startup', repo=self) |
233 # register a task to cleanup expired session |
233 # register a task to cleanup expired session |
234 self.looping_task(self.config['session-time']/3., |
234 self.looping_task(config['session-time']/3., self.clean_sessions) |
235 self.clean_sessions) |
|
236 CW_EVENT_MANAGER.bind('after-registry-reload', self.reset_hooks) |
235 CW_EVENT_MANAGER.bind('after-registry-reload', self.reset_hooks) |
237 |
236 |
238 # internals ############################################################### |
237 # internals ############################################################### |
239 |
238 |
240 def get_source(self, uri, source_config): |
239 def get_source(self, uri, source_config): |