def get_multi(self, keys): keys = [adapter.convert_key(k) for k in keys] keys = [web.safestr(k) for k in keys] d = self._client.get_multi(keys) return dict( (web.safeunicode(adapter.unconvert_key(k)), self.decompress(v)) for k, v in d.items())
def get(self, key): key = adapter.convert_key(key) if key is None: return None try: value = self._client.get(web.safestr(key)) except memcache.Client.MemcachedKeyError: return None return value and self.decompress(value)
def get_multi(self, keys): keys = [adapter.convert_key(k) for k in keys] keys = [web.safestr(k) for k in keys] d = self._client.get_multi(keys) return dict((web.safeunicode(adapter.unconvert_key(k)), self.decompress(v)) for k, v in d.items())