]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blame - www/webapp/backend/memcached.py
fireinfo: Some design fixes for ARM.
[people/shoehn/ipfire.org.git] / www / webapp / backend / memcached.py
CommitLineData
b3250465
MT
1#!/usr/bin/python
2
3import memcache
4
5from misc import Singleton
6from settings import Settings
7
8class 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)