def init_service(self, name): """ Initialize a not yet initialized service. Raises ComponentLookupError if the service has nor been found """ self.logger.info('Initializing service') self.logger.debug('Service name is %s' % name) try: srv = self._uninitialized_services.pop(name) except KeyError: raise component.ComponentLookupError(IService, name) else: srv.init(self) self.component_registry.register_utility(srv, IService, name) self.handle(ServiceInitializedEvent(name, srv)) return srv
def init_service(self, name): """ Initialize a not yet initialized service. Raises ComponentLookupError if the service has not been found """ try: srv = self._uninitialized_services.pop(name) except KeyError: raise component.ComponentLookupError(IService, name) else: logger.info("initializing service service.%s" % name) srv.init(self) # Bootstrap hassle: if name == "component_registry": self.component_registry = srv self.component_registry.register_utility(srv, IService, name) self.component_registry.handle(ServiceInitializedEvent(name, srv)) return srv
def init_service(self, name): """ Initialize a not yet initialized service. Raises ComponentLookupError if the service has not been found """ try: srv = self._uninitialized_services.pop(name) except KeyError: raise component.ComponentLookupError(IService, name) else: logger.info('initializing service service.%s' % name) srv.init(self) # Bootstrap symptoms if name in self.essential_services: setattr(self, name, srv) self.component_registry.register_utility(srv, IService, name) self.component_registry.handle(ServiceInitializedEvent(name, srv)) return srv