(self, key, value, overwrite=True)
Set a value of a key.

        If it cannot find the file or their contents are not a right json data,
        it will overwrite it with the key and value pair.

        Args:
            key (str): The key to store.
            value (str): The value to store.
            overwrite (boolean, optional): If *True* it should overwrite and
                existing key. Defaults to *True*.

        Raises:
            EnvironmentError: If it cannot store the file.
            ValueError: If not overwrite and the key exists.
Set a value of a key.
Set a value of a key .
def set(self, key, value, overwrite=True):
        """Set a value of a key.

        If it cannot find the file or their contents are not a right json data,
        it will overwrite it with the key and value pair.

        Args:
            key (str): The key to store.
            value (str): The value to store.
            overwrite (boolean, optional): If *True* it should overwrite and
                existing key. Defaults to *True*.

        Raises:
            EnvironmentError: If it cannot store the file.
            ValueError: If not overwrite and the key exists.

        """
        try:
            with open(self.filename) as json_file:
                json_data = json.load(json_file)
        except (EnvironmentError, ValueError):
            json_data = {}

        if key in json_data and not overwrite:
            raise ValueError("Key '%s' exists." % key)

        json_data[key] = value

        SecretIsbg._store_data(self.filename, json_data)
def set ( self , key , value , overwrite = True ) : try : with open ( self . filename ) as json_file : json_data = json . load ( json_file ) except ( EnvironmentError , ValueError ) : json_data = { } if key in json_data and not overwrite : raise ValueError ( "Key '%s' exists." % key ) json_data [ key ] = value SecretIsbg . _store_data ( self . filename , json_data )