Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)
function to set a memcached entity, currently supports Google App Engine memcache,
will add generic app engine client

        def cacheSet(key, text, ttl=3600):
    """
    function to set a memcached entity, currently supports Google App Engine memcache,
    will add generic app engine client
    """
    if memcached:
        if memcached_service == 'google':
            if type(ttl) is not int:
                ttl = 3600
            else:
                if (ttl) < 600: ttl = 600
            if len(text) > 0: memcache.set(key, text, ttl)
            return True
    return False
        


src/a/v/avalon-HEAD/gengo_tm.py   avalon(Download)
from utf8 import utf8
from cache import cacheGet
from cache import cacheSet
 
"""
    tt = utf8(response['response']['job']['body_tgt'])
    if len(tt) > 0:
        cacheSet('/gengo/' + sl + '/' + tl + '/' + text, tt, ttl)
        text = tt
    return tt

src/a/v/avalon-HEAD/cloudtext.py   avalon(Download)
from cache import cacheGet          # import wrapper function to read from memcached
from cache import cacheRunning      # checks if cache service is active
from cache import cacheSet          # import wrapper function to write to memcached
 
# import stub handlers for popular machine translation engines