def getAnnotations(name): metadatafile = File.metadatafileFromName(name) if os.path.exists(metadatafile): json_data=open(metadatafile) data = json.load(json_data) json_data.close() else: data = {} return data
def saveAnnotations(name, dict): metadatafile = File.metadatafileFromName(name) fp = open(metadatafile, mode='w') json.dump(dict, fp)