Skip to content

Commit

Permalink
mypy is unpinned on CI. It was updated and broke CI. These are the re…
Browse files Browse the repository at this point in the history
…quired typing fixes.
  • Loading branch information
rt121212121 committed Nov 8, 2022
1 parent 8ed8579 commit d2dda56
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions electrumsv/devices/hw_wallet/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ def version_str(t: Tuple[int]) -> str:
if (library_version == 'unknown' or
versiontuple(library_version) < self.minimum_library or # type: ignore
hasattr(self, "maximum_library") and
versiontuple(library_version) >= self.maximum_library): # type: ignore
versiontuple(library_version) >= self.maximum_library):
raise LibraryFoundButUnusable(library_version=library_version)
except ImportError:
return False
except LibraryFoundButUnusable as e:
library_version = e.library_version
max_version_str = (version_str(self.maximum_library) # type: ignore
max_version_str = (version_str(self.maximum_library)
if hasattr(self, "maximum_library") else "inf")
self.libraries_available_message = (
_("Library version for '{}' is incompatible.").format(self.name)
Expand Down
22 changes: 11 additions & 11 deletions electrumsv/gui/qt/amountedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ def numbify(self) -> None:

def paintEvent(self, event: QPaintEvent) -> None:
QLineEdit.paintEvent(self, event)
if self.base_unit_func:
panel = QStyleOptionFrame()
self.initStyleOption(panel)
textRect = self.style().subElementRect(QStyle.SubElement.SE_LineEditContents, panel,
self)
textRect.adjust(2, 0, -10, 0)
painter = QPainter(self)
painter.setPen(self.help_palette.brush(QPalette.ColorGroup.Disabled,
QPalette.ColorRole.Text).color())
painter.drawText(textRect, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter,
self.base_unit_func())

panel = QStyleOptionFrame()
self.initStyleOption(panel)
textRect = self.style().subElementRect(QStyle.SubElement.SE_LineEditContents, panel,
self)
textRect.adjust(2, 0, -10, 0)
painter = QPainter(self)
painter.setPen(self.help_palette.brush(QPalette.ColorGroup.Disabled,
QPalette.ColorRole.Text).color())
painter.drawText(textRect, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter,
self.base_unit_func())

def get_amount(self) -> Optional[Decimal]:
try:
Expand Down
8 changes: 4 additions & 4 deletions electrumsv/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,10 @@ def create_list_tab(self, list_widget: QWidget) -> TabWidget:
top_button_layout = TableTopButtonLayout()
if hasattr(list_widget, "reset_table"):
top_button_layout.refresh_signal.connect(
list_widget.reset_table) # type: ignore[attr-defined]
list_widget.reset_table)
else:
top_button_layout.refresh_signal.connect(self.refresh_wallet_display)
top_button_layout.filter_signal.connect(list_widget.filter) # type: ignore[attr-defined]
top_button_layout.filter_signal.connect(list_widget.filter)
w.on_search_toggled = partial( # type: ignore[attr-defined]
top_button_layout.on_toggle_filter)

Expand All @@ -1704,7 +1704,7 @@ def create_list_tab(self, list_widget: QWidget) -> TabWidget:
vbox.addWidget(list_widget)

if hasattr(list_widget, "update_top_button_layout"):
list_widget.update_top_button_layout(top_button_layout) # type: ignore[attr-defined]
list_widget.update_top_button_layout(top_button_layout)

return w

Expand Down Expand Up @@ -1813,7 +1813,7 @@ def _toggle_search(self) -> None:
self.show_warning(_("The current tab does not support searching."))
return

tab.on_search_toggled() # type: ignore[attr-defined]
tab.on_search_toggled()

def _show_wallet_information(self) -> None:
def open_file_explorer(path: str, *_discard: Iterable[Any]) -> None:
Expand Down
2 changes: 1 addition & 1 deletion electrumsv/gui/qt/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def update_fixed_tree_height(tree: QTreeWidget, maximum_height: Optional[int]=No
table_height = row_height * row_count
if maximum_height > 5:
table_height = min(table_height, maximum_height)
if tree.header().isVisible:
if tree.header().isVisible():
table_height += tree.header().height() + 2
tree.setFixedHeight(table_height)

Expand Down

0 comments on commit d2dda56

Please sign in to comment.