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:
parent
c3ae663f91
commit
34da018faf
|
@ -18,17 +18,7 @@ from common import gajim
|
||||||
|
|
||||||
USER_HAS_GNOMEKEYRING = False
|
USER_HAS_GNOMEKEYRING = False
|
||||||
USER_USES_GNOMEKEYRING = False
|
USER_USES_GNOMEKEYRING = False
|
||||||
if gajim.config.get('use_gnomekeyring'):
|
gnomekeyring = None
|
||||||
try:
|
|
||||||
import gnomekeyring
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
USER_HAS_GNOMEKEYRING = True
|
|
||||||
if gnomekeyring.is_available():
|
|
||||||
USER_USES_GNOMEKEYRING = True
|
|
||||||
else:
|
|
||||||
USER_USES_GNOMEKEYRING = False
|
|
||||||
|
|
||||||
class PasswordStorage(object):
|
class PasswordStorage(object):
|
||||||
def get_password(self, account_name):
|
def get_password(self, account_name):
|
||||||
|
@ -102,6 +92,20 @@ storage = None
|
||||||
def get_storage():
|
def get_storage():
|
||||||
global storage
|
global storage
|
||||||
if storage is None: # None is only in first time get_storage is called
|
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:
|
if USER_USES_GNOMEKEYRING:
|
||||||
try:
|
try:
|
||||||
storage = GnomePasswordStorage()
|
storage = GnomePasswordStorage()
|
||||||
|
|
Loading…
Reference in New Issue