def new(self, profile_name): ''' Creates a new profile with name 'profile_name' ''' if not profile_name in self.index: self.index[profile_name] = dict() self.index[profile_name]["directory"] = [FileTools.create_valid_name(profile_name)] profile_metadata = dict() FileTools.write_json(str(self.BASE_PATH.joinpath(profile_name + "/yamcl_metadata.json")), profile_metadata) self._flush_index()
def _flush_index(self): FileTools.write_json(self.index_path, self.index)
def flush_info(self): FileTools.write_json(self.info_path, self.json_info)
def _flush_index(self): ''' Writes current profile index in memory to the YAMCL data directory ''' FileTools.write_json(str(self.BASE_PATH.joinpath("index.json")), self.index)
def flush_metadata(self): ''' Writes current library index in memory to the YAMCL data directory ''' FileTools.write_json(str(self.data_path.joinpath("yamcl_metadata.json")), self.metadata)