Did I find the right examples for you? yes no

All Samples(75)  |  Call(75)  |  Derive(0)  |  Import(0)
Unconditionally sets a key to a given value in the memcache.

The C{key} can optionally be an tuple, with the first element
being the server hash value and the second being the key.
If you want to avoid making this module calculate a hash value.
You may prefer, for example, to keep all of a given user's objects
on the same memcache server, so you could use the user's unique
id as the hash value.

@return: Nonzero on success.(more...)

src/z/e/zenmachine-HEAD/decorator_example_memcache.py   zenmachine(Download)
                print "No cache"
                rp=f(*args, **kwargs) # execute original func
                mc.set(param, rp, 60) # set cache with 60 seconds expiration time
            return rp
        return wrapper

src/w/e/WebBot-HEAD/webbot/examples/test_memcache.py   WebBot(Download)
while True:
    mc.set('key', random())

src/g/r/graphite-HEAD/contrib/memcache_whisper.py   graphite(Download)
    def close(self):
      if self.mode == "r+b" or self.mode == "wb":
        MC.set(self.name, self.getvalue(), min_compress_len = min_compress_len)

src/t/o/Tornado-Watch-HEAD/htdocs/htdocs/python/get_markers.py   Tornado-Watch(Download)
        marker_list = [{"lat": 0, "lng": 0, "priority": 'f'}]
    jsonout = json.dumps(marker_list)
    mc.set("marker_list", jsonout, time=30)
    cgi_output(req, jsonout)

src/t/o/Tornado-Watch-HEAD/htdocs/django_tw/web/views.py   Tornado-Watch(Download)
        marker_list = [{"lat": 0, "lng": 0, "priority": 'f'}]
    jsonout = json.dumps(marker_list)
    mc.set("marker_list", jsonout, time=30)
    return HttpResponse(jsonout, mimetype="text/plain")

src/t/o/Tornado-Watch-HEAD/htdocs/cgi-bin/get_markers.py   Tornado-Watch(Download)
        marker_list = [{"lat": 0, "lng": 0, "priority": 'f'}]
    jsonout = json.dumps(marker_list)
    mc.set("marker_list", jsonout, time=30)

src/s/h/sharek-HEAD/core/views.py   sharek(Download)
    if not topics_tree:
         topics_tree = Topic.objects.topics_tree()
         mc.set('topics_tree', topics_tree, settings.MEMCACHED_TIMEOUT)
    tags = mc.get('tags')
    if not tags:
         tags = Tag.objects.all()
         mc.set('tags', tags, settings.MEMCACHED_TIMEOUT)
    if not contributions:
         contributions = Topic.total_contributions()
         mc.set('contributions', contributions, 3600) # 15 Minutes
    top_users = mc.get('top_users')
    if not top_users:
         top_users = User.get_top_users(24)
         mc.set('top_users', top_users, settings.MEMCACHED_TIMEOUT)
    if not top_liked:
         top_liked = ArticleDetails.objects.get_top_liked(5)
         mc.set('top_liked', top_liked, settings.MEMCACHED_TIMEOUT)
    top_commented = mc.get('top_commented')

src/t/i/TileStache-HEAD/TileStache/Memcache.py   TileStache(Download)
            mem.set(key+'-lock', 'locked.', layer.stale_lock_timeout)
        key = tile_key(layer, coord, format, self.revision, self.key_prefix)
        mem.set(key, body, layer.cache_lifespan or 0)

src/s/h/sharek-HEAD/core/reports/views.py   sharek(Download)
    if not chart_data:
         chart_data = Feedback.objects.feedback_charts()
         mc.set('chart_data', chart_data, settings.MEMCACHED_TIMEOUT)
    context = Context({'user': user, 'chart_data': chart_data})
        if not topic:
             topic = get_object_or_404( Topic, slug=topic_slug )
             mc.set('topic_' + str(topic_slug), topic, settings.MEMCACHED_TIMEOUT)
        articles = mc.get(str(topic_slug) + '_articles')
        if not articles:
             articles = topic.get_articles()
             mc.set(str(topic_slug) + '_articles', articles, settings.MEMCACHED_TIMEOUT)

src/m/e/metartg-HEAD/metartg/server.py   metartg(Download)
        server = clusto.get(instanceid)
        hostname = server[0].attr_value(key='system', subkey='hostname')
        cache.set(key, hostname, 300)
        return hostname
        cache.set(key, instanceid, 300)
    servers = list(gpool.imap(get_server_info, first.intersection(*pools)))
    servers.sort(key=lambda x: x['name'])
    cache.set(cachekey, json.dumps(servers), 300)
    return dumps(servers)

  1 | 2 | 3 | 4 | 5  Next