How to use the cryptostore.config.AttrDict function in cryptostore

To help you get started, we’ve selected a few cryptostore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bmoscon / cryptostore / cryptostore / config.py View on Github external
def __setitem__(self, key, value):
        if isinstance(value, dict):
            value = AttrDict(value)
        super().__setitem__(key, value)
github bmoscon / cryptostore / cryptostore / config.py View on Github external
async def __loader(self, file, interval, callback):
        last_modified = 0
        while True:
            cur_mtime = os.stat(file).st_mtime
            if cur_mtime != last_modified:
                with open(file, 'r') as fp:
                    self.config = AttrDict(yaml.load(fp, Loader=yaml.FullLoader))
                    if callback is not None:
                        await callback(self.config)
                    last_modified = cur_mtime

            await asyncio.sleep(interval)
github bmoscon / cryptostore / cryptostore / config.py View on Github external
def __init__(self, file_name):
        with open(file_name) as fp:
            self.config = AttrDict(yaml.load(fp, Loader=yaml.FullLoader))