(self)
Save settings in a file.

        .. NOTE::

            Settings are located in
            ``$XDG_CONFIG_HOME/rivalcfg/<vendor_id>_<product_id>.device.json``.
Save settings in a file.
Save settings in a file .
def save(self):
        """Save settings in a file.

        .. NOTE::

            Settings are located in
            ``$XDG_CONFIG_HOME/rivalcfg/<vendor_id>_<product_id>.device.json``.
        """
        settings_dir = os.path.dirname(self._settings_path)
        if not os.path.isdir(settings_dir):
            os.makedirs(settings_dir)
        with open(self._settings_path, "w") as file_:
            json.dump(self._settings, file_, indent=2)
def save ( self ) : settings_dir = os . path . dirname ( self . _settings_path ) if not os . path . isdir ( settings_dir ) : os . makedirs ( settings_dir ) with open ( self . _settings_path , "w" ) as file_ : json . dump ( self . _settings , file_ , indent = 2 )