changeset e8d44379f2de in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=e8d44379f2de description: migrate from kwalletbindings to libsecret too
diffstat:
src/common/passwords.py | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
diffs (29 lines):
diff -r edd83d9b41d2 -r e8d44379f2de src/common/passwords.py --- a/src/common/passwords.py Sat Jul 18 15:44:36 2015 +0200 +++ b/src/common/passwords.py Sat Jul 18 15:52:08 2015 +0200 @@ -168,8 +168,15 @@
def get_password(self, account_name): conf = gajim.config.get_per('accounts', account_name, 'password') - if conf is None or conf == '<kwallet>': + if conf is None: return None + if conf == '<kwallet>': + # Migrate from kwallet + if kwalletbinding.kwallet_available(): + kw_storage = KWalletPasswordStorage() + password = kw_storage.get_password(account_name) + self.save_password(account_name, password) + return password if conf.startswith('gnomekeyring:'): # migrate from libgnomekeyring GnomePasswordStorage @@ -188,7 +195,7 @@ except GnomeKeyringError: return None password = gk_storage.get_password(account_name) - save_password(account_name, password) + self.save_password(account_name, password) return password if not conf.startswith('libsecret:'): password = conf