memory: add class ProfileSessions based on Sessions
This commit is contained in:
parent
7a29fae242
commit
c9f4397000
1 changed files with 57 additions and 5 deletions
|
|
@ -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__()
|
||||
|
|
|
|||
Loading…
Reference in a new issue