def __init__(self, config: str): super().__init__() self.plugins = [] self.cfg = None if config: self.cfg = Config(config) else: if 'CRYPTOSTORE_CONFIG' in os.environ: file_name = os.environ['CRYPTOSTORE_CONFIG'] else: file_name = os.path.join(os.getcwd(), 'config.yaml') if os.path.isfile(file_name): self.cfg = Config(file_name)
def run(self): loop = asyncio.get_event_loop() self.config = Config(file_name=self.config_file) loop.create_task(self.loop()) try: loop.run_forever() except KeyboardInterrupt: pass
def run(self): LOG.info("Starting cryptostore") self.spawner.start() LOG.info("Spawner started") self.aggregator = Aggregator(config_file=self.cfg_path) self.aggregator.start() LOG.info("Aggregator started") loop = asyncio.get_event_loop() self.config = Config(file_name=self.cfg_path, callback=self._reconfigure) LOG.info("Cryptostore started") loop.run_forever()
def __init__(self, config): super().__init__(config) self.config = Config(config) self.daemon = True self.threads = []