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
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
def clear_cache(self, key): Mem.delete(key)
def get_cache(self, key): return Mem.get(key)
def set_cache(self, key, val, time_out): return Mem.set(key, val, time_out)
def destroy(self): Mem.delete(self._session_id)