Commits

Jason R. Coombs committed 6281d74

Fixed minor issues with get_all_keyring

Comments (0)

Files changed (2)

keyring/backend.py

 Keyring implementation support
 """
 
+import itertools
+
 from keyring.py25compat import abc
 from keyring import errors
 
     """
     __metaclass__ = KeyringBackendMeta
 
-    @abc.abstractproperty
+    #@abc.abstractproperty
     def priority(cls):
         """
         Each backend class must supply a priority, a number (float or integer)
     Return a list of all implemented keyrings that can be constructed without
     parameters.
     """
-    return list(keyring.util.suppress_exceptions(KeyringBackend._classes,
+    def is_class_viable(keyring_cls):
+        try:
+            keyring_cls.priority
+        except RuntimeError:
+            return False
+        return True
+
+    all_classes = KeyringBackend._classes
+    viable_classes = itertools.ifilter(is_class_viable, all_classes)
+    return list(keyring.util.suppress_exceptions(viable_classes,
         exceptions=TypeError))
 
 # for backward-compatibility
 from keyring.backends.Windows import EncryptedKeyring as Win32CryptoKeyring
 from keyring.backends.Windows import WinVaultKeyring
 from keyring.backends.Windows import RegistryKeyring as Win32CryptoRegistry
-from keyring.backends.Windows import select_windows_backend
 from keyring.backends.Google import DocsKeyring as GoogleDocsKeyring
 from keyring.credentials import Credential
 from keyring.credentials import SimpleCredential as BaseCredential

keyring/backends/multi.py

 import itertools
 
+from keyring.util import properties
 from keyring.backend import KeyringBackend
 from keyring import errors