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]
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()
def delete_password(self, service, username): try: del self.passwords[(service, username)] except KeyError: raise errors.PasswordDeleteError("not set")
def delete_password(self, service, username): """Delete the password for the username of the service. """ raise errors.PasswordDeleteError("reason")
def delete_password(self, service, username): try: del self.pwd[(service, username)] except KeyError: raise errors.PasswordDeleteError("No key")