]> git.ipfire.org Git - ipfire.org.git/blob - webapp/backend/memcached.py
Remove obsolete pakfire CGI scripts.
[ipfire.org.git] / webapp / backend / memcached.py
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)
22
23 def delete(self, *args, **kwargs):
24 return self._connection.delete(*args, **kwargs)