Author: nk Date: 2006-10-20 12:14:15 +0200 (Fri, 20 Oct 2006) New Revision: 7301
Modified: trunk/src/common/passwords.py Log: do not do gnomekeyring.is_available check eveyrytime (only once); remove an assert
Modified: trunk/src/common/passwords.py =================================================================== --- trunk/src/common/passwords.py 2006-10-20 10:08:08 UTC (rev 7300) +++ trunk/src/common/passwords.py 2006-10-20 10:14:15 UTC (rev 7301) @@ -21,9 +21,12 @@ try: import gnomekeyring except ImportError: - USER_HAS_GNOMEKEYRING = False + USER_USES_GNOMEKEYRING = False else: - USER_HAS_GNOMEKEYRING = True + if gnomekeyring.is_available(): + USER_USES_GNOMEKEYRING = True + else: + USER_USES_GNOMEKEYRING = False
class PasswordStorage(object): def get_password(self, account_name): @@ -85,7 +88,7 @@ def get_storage(): global storage if storage is None: # None is only in first time get_storage is called - if USER_HAS_GNOMEKEYRING and gnomekeyring.is_available(): + if USER_USES_GNOMEKEYRING: try: storage = GnomePasswordStorage() except gnomekeyring.NoKeyringDaemonError: @@ -96,7 +99,6 @@
def set_storage(storage_): global storage - assert isinstance(storage, PasswordStorage) storage = storage_