def __init__(self, config=None, child_configuration=None): """ Initialize Simplevisor. """ if config is None: config = dict() elif type(config) != dict: raise SimplevisorError("Simplevisor expect a configuration dictionary.") self._config = config self._status_file = self._config.get("store") self._running = False self._child = supervisor.new_child(child_configuration) self.initialize_log()
def __init__(self, config=None, child_config=None): """ Initialize Simplevisor. """ if config is None: config = dict() elif type(config) != dict: raise SimplevisorError("Simplevisor config is not a dictionary") if "logname" not in config: config["logname"] = self.__class__.__name__ self.logger = logging.getLogger(config["logname"]) mtb.pid.LOGGER = self.logger self._config = config self._status_file = self._config.get("store") self._running = False if child_config is None: self._child = None else: if "logname" not in child_config: child_config["logname"] = config["logname"] self._child = supervisor.new_child(child_config)