Exemplo n.º 1
0
 def _del_entry(self, keyring_dict, service, username):
     service_entries = keyring_dict.get(service)
     if not service_entries:
         raise errors.PasswordDeleteError("No matching service")
     try:
         del service_entries[username]
     except KeyError:
         raise errors.PasswordDeleteError("Not found")
     if not service_entries:
         del keyring_dict[service]
Exemplo n.º 2
0
    def delete_password(self, service, username):
        service = escape_for_ini(service)
        username = escape_for_ini(username)

        try:
            self.config.remove_option(service, username)
        except configparser.NoSectionError:
            raise errors.PasswordDeleteError('Password not found')
        config_file = UnicodeWriterAdapter(self._open('w'))
        self.config.write(config_file)
        config_file.close()
Exemplo n.º 3
0
 def delete_password(self, service, username):
     try:
         del self.passwords[(service, username)]
     except KeyError:
         raise errors.PasswordDeleteError("not set")
Exemplo n.º 4
0
 def delete_password(self, service, username):
     """Delete the password for the username of the service.
     """
     raise errors.PasswordDeleteError("reason")
Exemplo n.º 5
0
 def delete_password(self, service, username):
     try:
         del self.pwd[(service, username)]
     except KeyError:
         raise errors.PasswordDeleteError("No key")