Mercurial > libervia-backend
comparison src/memory/memory.py @ 1694:3c608d660f0b
core (memory): profile is checked in startSession (an error is raised if it doesn't exist)
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 27 Nov 2015 16:50:29 +0100 |
parents | 35426d58471c |
children | 5a93f13c1e76 |
comparison
equal
deleted
inserted
replaced
1693:35426d58471c | 1694:3c608d660f0b |
---|---|
316 @param profile: %(doc_profile)s""" | 316 @param profile: %(doc_profile)s""" |
317 return self.params.loadIndParams(profile) | 317 return self.params.loadIndParams(profile) |
318 | 318 |
319 ## Profiles/Sessions management ## | 319 ## Profiles/Sessions management ## |
320 | 320 |
321 def _startSession(self, password, profile_key): | |
322 profile = self.getProfileName(profile_key) | |
323 return self.startSession(password, profile) | |
324 | |
325 def startSession(self, password, profile): | 321 def startSession(self, password, profile): |
326 """"Iniatialise session for a profile | 322 """"Iniatialise session for a profile |
327 | 323 |
328 @param password(unicode): profile session password | 324 @param password(unicode): profile session password |
329 or empty string is no password is set | 325 or empty string is no password is set |
330 @param profile: %(doc_profile)s | 326 @param profile: %(doc_profile)s |
331 """ | 327 @raise exceptions.ProfileUnknownError if profile doesn't exists |
328 @raise exceptions.PasswordError: the password does not match | |
329 """ | |
330 profile = self.getProfileName(profile) | |
331 | |
332 def createSession(dummy): | 332 def createSession(dummy): |
333 """Called once params are loaded.""" | 333 """Called once params are loaded.""" |
334 self._entities_cache[profile] = {} | 334 self._entities_cache[profile] = {} |
335 log.info(u"[{}] Profile session started".format(profile)) | 335 log.info(u"[{}] Profile session started".format(profile)) |
336 return False | 336 return False |