def saveLibraryData(self, data, file_name): """ Stores the data of the libraries in a json file Arguments: data {json} json data with the libraries file_name {string} name of the json file """ libraries_path = Paths.getLibraryPath() library_path = os.path.join(libraries_path, file_name) libraries = JSONFile(library_path) libraries.setData(data) libraries.saveData()
def getLibrary(self, file_name): """ Get a specific json file and return the data Arguments: file_name {string} Json file name where is stored the library data Returns: [dict] -- Dictionary with the library data """ plugin_path = Paths.getLibraryPath() library_path = os.path.join(plugin_path, file_name) libraries = JSONFile(library_path).getData() return libraries