Commits

Anonymous committed 384e166 Merge

Merging to include get_password-args-and-kwargs

  • Participants
  • Parent commits 6e6fa08, b19a9d8

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):