def __save__(self):
        """Save the config to __config_path__ in a json format."""

        if self.__xor_key__:
            jsonstr = json.dumps(self.__get_json_dict__()).encode()
            jsonstr = self.__crypt__(jsonstr)
        else:
            jsonstr = json.dumps(self.__get_json_dict__(), indent=4, sort_keys=True)

        LOGGER.info('saving %d chars at %s', len(jsonstr), self.__config_path__)

        mode = 'wb' if self.__xor_key__ else 'w'
        with open(self.__config_path__, mode) as f:
            f.write(jsonstr)
def __save__ ( self ) : if self . __xor_key__ : jsonstr = json . dumps ( self . __get_json_dict__ ( ) ) . encode ( ) jsonstr = self . __crypt__ ( jsonstr ) else : jsonstr = json . dumps ( self . __get_json_dict__ ( ) , indent = 4 , sort_keys = True ) LOGGER . info ( 'saving %d chars at %s' , len ( jsonstr ) , self . __config_path__ ) mode = 'wb' if self . __xor_key__ else 'w' with open ( self . __config_path__ , mode ) as f : f . write ( jsonstr )
Save the config to __config_path__ in a json format.