comparison src/memory/params.py @ 1624:7e749e8eefd0

core: fixed launchAction: - getClient now raise a NotFound error if client is not available - errors ConnectedProfileError, NotConnectedProfileError anf ProfileKeyUnknownError renamed for consistency (all profile error must prefixed by Profile) - launchAction fixed, the case where client is not available is handled - kept actions are actuall1y removed on launchAction
author Goffi <goffi@goffi.org>
date Wed, 18 Nov 2015 11:06:24 +0100
parents f4a0b12d2442
children 31b96ac3eec2
comparison
equal deleted inserted replaced
1623:ec48b35309dc 1624:7e749e8eefd0
181 if self.host.isConnected(profile): 181 if self.host.isConnected(profile):
182 if force: 182 if force:
183 self.host.disconnect(profile) 183 self.host.disconnect(profile)
184 else: 184 else:
185 log.info(_("Trying to delete a connected profile")) 185 log.info(_("Trying to delete a connected profile"))
186 return defer.fail(Failure(exceptions.ConnectedProfileError)) 186 return defer.fail(Failure(exceptions.ProfileConnected))
187 return self.storage.deleteProfile(profile) 187 return self.storage.deleteProfile(profile)
188 188
189 def getProfileName(self, profile_key, return_profile_keys=False): 189 def getProfileName(self, profile_key, return_profile_keys=False):
190 """return profile according to profile_key 190 """return profile according to profile_key
191 191
480 log.error(_('Requesting a param for an non-existant profile')) 480 log.error(_('Requesting a param for an non-existant profile'))
481 raise exceptions.ProfileUnknownError 481 raise exceptions.ProfileUnknownError
482 482
483 if profile not in self.params: 483 if profile not in self.params:
484 log.error(_('Requesting synchronous param for not connected profile')) 484 log.error(_('Requesting synchronous param for not connected profile'))
485 raise exceptions.NotConnectedProfileError(profile) 485 raise exceptions.ProfileNotConnected(profile)
486 486
487 if attr == "value": 487 if attr == "value":
488 value = self._getParam(category, name, profile=profile) 488 value = self._getParam(category, name, profile=profile)
489 if value is None and attr=='value' and not use_default: 489 if value is None and attr=='value' and not use_default:
490 return value 490 return value