diff options
author | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-12-05 13:00:27 +0100 |
---|---|---|
committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-12-06 11:52:07 +0100 |
commit | 592c734e57b00040329b49dfbe11869980dff88a (patch) | |
tree | 79fa3498cb974e5026415971ec83107b92b65919 /examples/widgets/tutorials/addressbook/part5.py | |
parent | c0329cff9d7378b8bf6a17baeb97bf5a240977fc (diff) |
Examples: Fix a number of flake8 errors (part 1)
First batch, including low-hanging fruit like Alignments, whitespaces,
line length, indents, etc.
Pick-to: 6.6
Change-Id: I55966876077f7fddfdc82cbe376677af9995f329
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/tutorials/addressbook/part5.py')
-rw-r--r-- | examples/widgets/tutorials/addressbook/part5.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/examples/widgets/tutorials/addressbook/part5.py b/examples/widgets/tutorials/addressbook/part5.py index 72245703f..921c210d4 100644 --- a/examples/widgets/tutorials/addressbook/part5.py +++ b/examples/widgets/tutorials/addressbook/part5.py @@ -134,34 +134,34 @@ class AddressBook(QWidget): address = self._address_text.toPlainText() if name == "" or address == "": - QMessageBox.information(self, "Empty Field", - "Please enter a name and address.") + QMessageBox.information(self, "Empty Field", "Please enter a name and address.") return if self._current_mode == self.AddingMode: if name not in self.contacts: self.contacts[name] = address QMessageBox.information(self, "Add Successful", - f'"{name}" has been added to your address book.') + f'"{name}" has been added to your address book.') else: QMessageBox.information(self, "Add Unsuccessful", - f'Sorry, "{name}" is already in your address book.') + f'Sorry, "{name}" is already in your address book.') return elif self._current_mode == self.EditingMode: if self._old_name != name: if name not in self.contacts: QMessageBox.information(self, "Edit Successful", - f'"{self.oldName}" has been edited in your address book.') + f'"{self.oldName}" has been edited in your ' + 'address book.') del self.contacts[self._old_name] self.contacts[name] = address else: QMessageBox.information(self, "Edit Unsuccessful", - f'Sorry, "{name}" is already in your address book.') + f'Sorry, "{name}" is already in your address book.') return elif self._old_address != address: QMessageBox.information(self, "Edit Successful", - f'"{name}" has been edited in your address book.') + f'"{name}" has been edited in your address book.') self.contacts[name] = address self.update_interface(self.NavigationMode) @@ -179,15 +179,15 @@ class AddressBook(QWidget): if name in self.contacts: button = QMessageBox.question(self, "Confirm Remove", - f'Are you sure you want to remove "{name}"?', - QMessageBox.Yes | QMessageBox.No) + f'Are you sure you want to remove "{name}"?', + QMessageBox.Yes | QMessageBox.No) if button == QMessageBox.Yes: self.previous() del self.contacts[name] QMessageBox.information(self, "Remove Successful", - f'"{name}" has been removed from your address book.') + f'"{name}" has been removed from your address book.') self.update_interface(self.NavigationMode) @@ -243,7 +243,7 @@ class AddressBook(QWidget): self._address_text.setText(self.contacts[contact_name]) else: QMessageBox.information(self, "Contact Not Found", - f'Sorry, "{contact_name}" is not in your address book.') + f'Sorry, "{contact_name}" is not in your address book.') return self.update_interface(self.NavigationMode) @@ -311,8 +311,7 @@ class FindDialog(QDialog): text = self._line_edit.text() if not text: - QMessageBox.information(self, "Empty Field", - "Please enter a name.") + QMessageBox.information(self, "Empty Field", "Please enter a name.") return else: self._find_text = text |