How to use the everett.manager.generate_uppercase_key function in everett

To help you get started, we’ve selected a few everett 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 willkg / everett / tests / test_manager.py View on Github external
def test_generate_uppercase_key(key, ns, expected):
    full_key = generate_uppercase_key(key, ns)
    assert full_key == expected
github willkg / everett / everett / ext / inifile.py View on Github external
def get(self, key, namespace=None):
        """Retrieve value for key."""
        if not self.path:
            return NO_VALUE

        # NOTE(willkg): The "main" section is considered the root mainspace.
        namespace = namespace or ["main"]
        logger.debug("Searching %r for key: %s, namespace: %s", self, key, namespace)
        full_key = generate_uppercase_key(key, namespace)
        return get_key_from_envs(self.cfg, full_key)
github willkg / everett / everett / ext / yamlfile.py View on Github external
def get(self, key, namespace=None):
        """Retrieve value for key."""
        if not self.path:
            return NO_VALUE

        logger.debug("Searching %r for key: %s, namepsace: %s", self, key, namespace)
        full_key = generate_uppercase_key(key, namespace)
        return get_key_from_envs(self.cfg, full_key)
github zyfra / ebonite / src / ebonite / config.py View on Github external
def get(self, key, namespace=None):
        name = generate_uppercase_key(key, namespace).lower()
        if name in self.cache:
            return self.cache[name]
        parser = argparse.ArgumentParser()
        parser.add_argument(f'--{name}')
        args = parser.parse_known_args([name])
        res = getattr(args, name, NO_VALUE)
        self.cache[name] = res
        return res