giraffez/config.py
def get_value(self, key, default={}, nested=True, decrypt=True):
        """
        Retrieve a value from the configuration based on its key. The key
        may be nested.

        :param str key: A path to the value, with nested levels joined by '.'
        :param default: Value to return if the key does not exist (defaults to :code:`dict()`)
        :param bool decrypt: If :code:`True`, decrypt an encrypted value before returning
            (if encrypted).  Defaults to :code:`True`.
        """
        key = key.lstrip()
        if key.endswith("."):
            key = key[:-1]
        if nested:
            path = key.split(".")
            curr = self.settings
            for p in path[:-1]:
                curr = curr.get(p, {})
            try:
                value = curr[path[-1]]
            except KeyError:
                return default
            value = self.decrypt(value, path)
            return value
        else:
            return self.settings.get(key, default)
def get_value(self, key, default={}, nested=True, decrypt=True):
        """
        Retrieve a value from the configuration based on its key. The key
        may be nested.

        :param str key: A path to the value, with nested levels joined by '.'
        :param default: Value to return if the key does not exist (defaults to :code:`dict()`)
        :param bool decrypt: If :code:`True`, decrypt an encrypted value before returning
            (if encrypted).  Defaults to :code:`True`.
        """
        key = key.lstrip()
        if key.endswith("."):
            key = key[:-1]
        if nested:
            path = key.split(".")
            curr = self.settings
            for p in path[:-1]:
                curr = curr.get(p, {})
            try:
                value = curr[path[-1]]
            except KeyError:
                return default
            value = self.decrypt(value, path)
            return value
        else:
            return self.settings.get(key, default)
Retrieve a value from the configuration based on its key. The key
        may be nested.

        :param str key: A path to the value, with nested levels joined by '.'
        :param default: Value to return if the key does not exist (defaults to :code:`dict()`)
        :param bool decrypt: If :code:`True`, decrypt an encrypted value before returning
            (if encrypted).  Defaults to :code:`True`.