]>
Commit | Line | Data |
---|---|---|
b3250465 MT |
1 | #!/usr/bin/python |
2 | ||
3 | import memcache | |
4 | ||
5 | from misc import Singleton | |
6 | from settings import Settings | |
7 | ||
8 | class Memcached(object): | |
9 | __metaclass__ = Singleton | |
10 | ||
11 | def __init__(self): | |
12 | # Fetch hosts from database | |
13 | hosts = Settings().get("memcached_servers").split(",") | |
14 | ||
15 | self._connection = memcache.Client(hosts, debug=0) | |
16 | ||
17 | def get(self, *args, **kwargs): | |
18 | return self._connection.get(*args, **kwargs) | |
19 | ||
20 | def set(self, *args, **kwargs): | |
21 | return self._connection.set(*args, **kwargs) | |
3504c80a MT |
22 | |
23 | def delete(self, *args, **kwargs): | |
24 | return self._connection.delete(*args, **kwargs) |