Beispiel #1
0
    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())
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
 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())