comparison src/memory/params.py @ 938:fc7e0828b18e

plugin account, groupblog: user can erase all their microblogs at once
author souliane <souliane@mailoo.org>
date Thu, 27 Mar 2014 02:24:20 +0100
parents 1a759096ccbd
children e1842ebcb2f3
comparison
equal deleted inserted replaced
937:255e6953b2c3 938:fc7e0828b18e
152 @return: a Deferred instance 152 @return: a Deferred instance
153 """ 153 """
154 if not self.storage.hasProfile(profile): 154 if not self.storage.hasProfile(profile):
155 info(_('Trying to delete an unknown profile')) 155 info(_('Trying to delete an unknown profile'))
156 return defer.fail(Failure(exceptions.ProfileUnknownError)) 156 return defer.fail(Failure(exceptions.ProfileUnknownError))
157 if not force and self.host.isConnected(profile): 157 if self.host.isConnected(profile):
158 info(_("Trying to delete a connected profile")) 158 if force:
159 return defer.fail(Failure(exceptions.ConnectedProfileError)) 159 self.host.disconnect(profile)
160 else:
161 info(_("Trying to delete a connected profile"))
162 return defer.fail(Failure(exceptions.ConnectedProfileError))
160 return self.storage.deleteProfile(profile) 163 return self.storage.deleteProfile(profile)
161 164
162 def getProfileName(self, profile_key, return_profile_keys = False): 165 def getProfileName(self, profile_key, return_profile_keys = False):
163 """return profile according to profile_key 166 """return profile according to profile_key
164 @param profile_key: profile name or key which can be 167 @param profile_key: profile name or key which can be