don't try to read ACE option before configure file is read. import gnome keyring after config file is read. fixes #2917

This commit is contained in:
Yann Leboulanger 2007-01-21 15:13:57 +00:00
parent c3ae663f91
commit 34da018faf
1 changed files with 15 additions and 11 deletions

View File

@ -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()