Beispiel #1
0
 def get(self, key):
     val = Mem.get(self._session_id)
     if val is not None:
         Mem.set(self._session_id, val, self._time_out)
         if val.has_key(key):
             return val[key]
     return None
Beispiel #2
0
 def set(self, key, value):
     ret = False
     val = Mem.get(self._session_id)
     if val is None or isinstance(val, dict) == False:
         val = dict()
     val[key] = value
     ret = Mem.set(self._session_id, val, self._time_out)
     return ret
Beispiel #3
0
 def clear_cache(self, key):
     Mem.delete(key)
Beispiel #4
0
 def get_cache(self, key):
     return Mem.get(key)
Beispiel #5
0
 def set_cache(self, key, val, time_out):
     return Mem.set(key, val, time_out)
Beispiel #6
0
 def destroy(self):
     Mem.delete(self._session_id)