Did I find the right examples for you? yes no

All Samples(11)  |  Call(11)  |  Derive(0)  |  Import(0)
Add new key with value.

Like L{set}, but only stores in memcache if the key doesn't already exist.

@return: Nonzero on success.
@rtype: int

src/s/a/samples-HEAD/memcache-bench/memcachebench.py   samples(Download)
    start = time.time()
    for i in range(TOTAL):
        client.add("%d" % i, "Hello, World. %d" % i)
    end = time.time()
    diff = end - start

src/r/e/RedKindle-HEAD/model.py   RedKindle(Download)
			myvar = dict(name=name)
			result = list(db.select('kinuser',myvar,where='name = $name'))
			memc.add(hash('kinuser%s' % name),result,time=60*4)
		return result
	except:
		if not value:
			value = list(db.select('feeds'))
			memc.add(hash('feeds'),value,time=60*5)
		return value
	except:
		if not result:
			result = list(db.select('category'))
			memc.add(hash('cate'),result,time=60*60*5)
		return result
	except:
		if not result:
			result = db.query('select count(*) as count from kinuser')[0]
			memc.add(hash('count'),result,time=60*60)
		return result
	except:
			myvar = dict(f_id=feed_id)
			result = list(db.select('rss_gain',myvar,where='f_id=$f_id'))
			qq=memc.add(hash('rss_gain%s' % feed_id),result,time=60*5)
		return result
	except:

src/t/i/TileStache-HEAD/TileStache/Memcache.py   TileStache(Download)
        try:
            while _time() < due:
                if mem.add(key+'-lock', 'locked.', layer.stale_lock_timeout):
                    return
 

src/m/e/memcache-debug-panel-HEAD/test/__init__.py   memcache-debug-panel(Download)
        # add
        add = 'add'
        self.assertTrue(client.add(add, value), 'simple add, success')
        self.assertLastCall('add', add, 'simple add, success')
        self.assertFalse(client.add(add, value), 'simple add, exists')

src/c/a/Cache-Debug-Toolbar-HEAD/test/__init__.py   Cache-Debug-Toolbar(Download)
        # add
        add = 'add'
        self.assertTrue(client.add(add, value), 'simple add, success')
        self.assertLastCall('add', add, 'simple add, success')
        self.assertFalse(client.add(add, value), 'simple add, exists')