Esempio n. 1
0
def WebChar_cached(modulus, number, **kwds):
    if use_cache:
        label = "{0}.{1}".format(modulus, number)
        X = cache.get(label)
        emf_logger.critical("Looking for cached  char:{0}".format(label))
        if X is None:
            emf_logger.debug("X was not in cache!")
            X = WebChar(modulus, number, **kwds)
            cache.set(label, X, timeout=5 * 60)
        else:
            emf_logger.critical("X was in cache!")
    else:
        X = WebChar(modulus, number, **kwds)
    return X
def WebModFormSpace_cached(level,weight,character,**kwds):
    if use_cache: 
        label = space_label(level=level, weight=weight, character=character, make_cache_label = True)
        M= cache.get(label)
        emf_logger.debug("Looking for cached space:{0}".format(label))
        if M is None:
            emf_logger.debug("M was not in cache!")
            M = WebModFormSpace(level,weight,character,**kwds)
            cache.set(label, M, timeout=5 * 60)
        else:
            emf_logger.debug("M was in cache!")
    else:
        M = WebModFormSpace(level,weight,character,**kwds)
    return M
Esempio n. 3
0
def WebChar_cached(modulus, number, **kwds):
    if use_cache:
        label = "{0}.{1}".format(modulus, number)
        X = cache.get(label)
        emf_logger.critical("Looking for cached  char:{0}".format(label))
        if X is None:
            emf_logger.debug("X was not in cache!")
            X = WebChar(modulus, number, **kwds)
            cache.set(label, X, timeout=5 * 60)
        else:
            emf_logger.critical("X was in cache!")
    else:
        X = WebChar(modulus, number, **kwds)
    return X