Skip to content
Snippets Groups Projects
Commit 34da018f authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

don't try to read ACE option before configure file is read. import gnome...

don't try to read ACE option before configure file is read. import gnome keyring after config file is read. fixes #2917
parent c3ae663f
No related branches found
No related tags found
No related merge requests found
......@@ -18,17 +18,7 @@ from common import gajim
USER_HAS_GNOMEKEYRING = False
USER_USES_GNOMEKEYRING = False
if gajim.config.get('use_gnomekeyring'):
try:
import gnomekeyring
except ImportError:
pass
else:
USER_HAS_GNOMEKEYRING = True
if gnomekeyring.is_available():
USER_USES_GNOMEKEYRING = True
else:
USER_USES_GNOMEKEYRING = False
gnomekeyring = None
class PasswordStorage(object):
def get_password(self, account_name):
......@@ -102,6 +92,20 @@ storage = None
def get_storage():
global storage
if storage is None: # None is only in first time get_storage is called
if gajim.config.get('use_gnomekeyring'):
global gnomekeyring
try:
import gnomekeyring
except ImportError:
pass
else:
global USER_HAS_GNOMEKEYRING
global USER_USES_GNOMEKEYRING
USER_HAS_GNOMEKEYRING = True
if gnomekeyring.is_available():
USER_USES_GNOMEKEYRING = True
else:
USER_USES_GNOMEKEYRING = False
if USER_USES_GNOMEKEYRING:
try:
storage = GnomePasswordStorage()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment