Commits

Anonymous committed b19a9d8

Allow *args and **kwargs to be passed to keyrings, for implementation specific features. This is probably really bad in the eyes of the main developer, but I'm sorry. I *need* it.

Comments (0)

Files changed (5)

demo/simplekeyring.py

     def supported(self): 
         return 0
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         return self.password
 
     def set_password(self, service, username, password):

keyring/backend.py

         return -1
 
     @abc.abstractmethod
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Get password of the username for the service
         """
         return None
             return 1
         return 0
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Override the get_password() in KeyringBackend.
         """
         try:
             else:
                 return 0
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Get password of the username for the service
         """
         import gnomekeyring
             else:
                 return unicode(s, errors='replace')
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Get password of the username for the service
         """
         import dbus
         else:
             return -1
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Get password of the username for the service
         """
         key = username + '@' + service
         # disable this function - it only needs to be run once
         self._relocate_file = lambda: None
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Read the password from the file.
         """
         self._relocate_file()
     def _compound_name(username, service):
         return keyring.util.escape.u('%(username)s@%(service)s') % vars()
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         # first attempt to get the password under the service name
         res = self._get_password(service)
         if not res or res['UserName'] != username:
         else:
             return 0
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         """Get password of the username for the service
         """
         from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx
     """
     return _keyring_backend
 
-def get_password(service_name, username):
+def get_password(service_name, username, *args, **kwargs):
     """Get password from the specified service
     """
-    return _keyring_backend.get_password(service_name, username)
+    return _keyring_backend.get_password(service_name, username, *args, **kwargs)
 
 def set_password(service_name, username, password):
     """Set password for the user in the specified service

keyring/tests/test_cli.py

     def set_password(self, service, username, password):
         pass
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         return self.PASSWORD
 
 
     def set_password(self, service, username, password):
         self.pwd[(service, username)] = password
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         try:
             return self.pwd[(service, username)]
         except KeyError:

keyring/tests/test_core.py

     def supported(self):
         return 0
 
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         return PASSWORD_TEXT
 
     def set_password(self, service, username, password):
 class TestKeyring2(TestKeyring):
     """Another faked keyring for test.
     """
-    def get_password(self, service, username):
+    def get_password(self, service, username, *args, **kwargs):
         return PASSWORD_TEXT_2
 
 class CoreTestCase(unittest.TestCase):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.