Commit c6aab1bc authored by Jannis Leidel's avatar Jannis Leidel Committed by Sean Bleier

Slight cosmetic changes.

parent 0d790a12
......@@ -51,7 +51,8 @@ class CacheClass(BaseCache):
Persist a value to the cache, and set an optional expiration time.
"""
# pickle the value
value = base64.encodestring(pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip()
value = base64.encodestring(
pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip()
# store the key/value pair
result = self._cache.set(smart_str(key), value)
# set expiration if needed
......@@ -105,7 +106,8 @@ class CacheClass(BaseCache):
"""
safe_data = {}
for key, value in data.iteritems():
safe_data[smart_str(key)] = base64.encodestring(pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip()
safe_data[smart_str(key)] = base64.encodestring(
pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip()
self._cache.mset(safe_data)
map(self.expire, safe_data, [timeout]*len(safe_data))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment