memory: add class ProfileSessions based on Sessions

This commit is contained in:
souliane 2014-05-10 17:37:32 +02:00
commit c9f4397000

View file

@ -43,12 +43,15 @@ class PersistentDict(object):
self.profile = profile
def load(self):
"""load persistent data from storage
"""Load persistent data from storage.
@return: defers the PersistentDict instance itself
"""
if not self.profile:
return self.storage.loadGenPrivates(self._cache, self.namespace)
d = self.storage.loadGenPrivates(self._cache, self.namespace)
else:
return self.storage.loadIndPrivates(self._cache, self.namespace, self.profile)
d = self.storage.loadIndPrivates(self._cache, self.namespace, self.profile)
return d.addCallback(lambda dummy: self)
def __repr__(self):
return self._cache.__repr__()