From 1bf3950ce6b45cdec5f0298ffa3193e74ce5be89 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 27 Nov 2015 16:50:29 +0100 Subject: [PATCH] core (memory): profile is checked in startSession (an error is raised if it doesn't exist) --- src/core/sat_main.py | 2 +- src/memory/memory.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/sat_main.py b/src/core/sat_main.py index c35ac578..f9163a4c 100644 --- a/src/core/sat_main.py +++ b/src/core/sat_main.py @@ -74,7 +74,7 @@ class SAT(service.Service): self.bridge.register("getEntitiesData", self.memory._getEntitiesData) self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile) self.bridge.register("asyncDeleteProfile", self.memory.asyncDeleteProfile) - self.bridge.register("profileStartSession", self.memory._startSession) + self.bridge.register("profileStartSession", self.memory.startSession) self.bridge.register("profileIsSessionStarted", self.memory._isSessionStarted) self.bridge.register("profileSetDefault", self.memory.profileSetDefault) self.bridge.register("asyncConnect", self._asyncConnect) diff --git a/src/memory/memory.py b/src/memory/memory.py index 261ce9cc..85dc4db5 100644 --- a/src/memory/memory.py +++ b/src/memory/memory.py @@ -318,17 +318,17 @@ class Memory(object): ## Profiles/Sessions management ## - def _startSession(self, password, profile_key): - profile = self.getProfileName(profile_key) - return self.startSession(password, profile) - def startSession(self, password, profile): """"Iniatialise session for a profile @param password(unicode): profile session password or empty string is no password is set @param profile: %(doc_profile)s + @raise exceptions.ProfileUnknownError if profile doesn't exists + @raise exceptions.PasswordError: the password does not match """ + profile = self.getProfileName(profile) + def createSession(dummy): """Called once params are loaded.""" self._entities_cache[profile] = {}