giraffez/config.py
def unlock_connection(cls, conf, dsn, key=None):
        """
        A class method to unlock a connection (given by :code:`dsn`) in the specified
        configuration file. Automatically opens the file and writes to it before
        closing.

        :param str conf: The configuration file to modify
        :param str dsn: The name of the connection to unlock
        :raises `giraffez.errors.ConfigurationError`: if the connection does not exist
        """
        with Config(conf, "w", key) as c:
            connection = c.connections.get(dsn, None)
            if not connection:
                raise ConfigurationError("Unable to unlock connection")
            if dsn is None:
                dsn = c.settings["connections"]["default"]
            if connection.get("lock", None) is None:
                raise GiraffeError("Connection '{}' is not locked.".format(dsn))
            c.unset_value("connections.{}.lock".format(dsn))
            c.write()
def unlock_connection(cls, conf, dsn, key=None):
        """
        A class method to unlock a connection (given by :code:`dsn`) in the specified
        configuration file. Automatically opens the file and writes to it before
        closing.

        :param str conf: The configuration file to modify
        :param str dsn: The name of the connection to unlock
        :raises `giraffez.errors.ConfigurationError`: if the connection does not exist
        """
        with Config(conf, "w", key) as c:
            connection = c.connections.get(dsn, None)
            if not connection:
                raise ConfigurationError("Unable to unlock connection")
            if dsn is None:
                dsn = c.settings["connections"]["default"]
            if connection.get("lock", None) is None:
                raise GiraffeError("Connection '{}' is not locked.".format(dsn))
            c.unset_value("connections.{}.lock".format(dsn))
            c.write()
A class method to unlock a connection (given by :code:`dsn`) in the specified
        configuration file. Automatically opens the file and writes to it before
        closing.

        :param str conf: The configuration file to modify
        :param str dsn: The name of the connection to unlock
        :raises `giraffez.errors.ConfigurationError`: if the connection does not exist