Example #1
0
def loadFileManInfoFromCache(cacheLocation, name, fmType, description=""):
    # TODO: change to get name etc from about
    fis = []
    for replyFile in os.listdir(cacheLocation):
        if not re.search(r'SCHEMA\_', replyFile):
            continue
        reply = json.loads(open(cacheLocation + replyFile).read())
        fi = FileInfo(reply, fmType)
        fis.append(fi)
    fileManInfo = FileManInfo(fis, name, fmType, description)
    if fileManInfo.size == 0:
        raise Exception("No schemas in cache - exiting")
    return fileManInfo