# HG changeset patch # User Goffi # Date 1448639429 -3600 # Node ID 3c608d660f0b6929a41cd185e31f983d1b5bf8f8 # Parent 35426d58471c91d3e2ba902612f62fc5eba0b97d core (memory): profile is checked in startSession (an error is raised if it doesn't exist) diff -r 35426d58471c -r 3c608d660f0b src/core/sat_main.py --- a/src/core/sat_main.py Fri Nov 27 16:48:41 2015 +0100 +++ b/src/core/sat_main.py Fri Nov 27 16:50:29 2015 +0100 @@ -74,7 +74,7 @@ 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 -r 35426d58471c -r 3c608d660f0b src/memory/memory.py --- a/src/memory/memory.py Fri Nov 27 16:48:41 2015 +0100 +++ b/src/memory/memory.py Fri Nov 27 16:50:29 2015 +0100 @@ -318,17 +318,17 @@ ## 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] = {}