Skip to content

Commit

Permalink
Remove unused params/args
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Jul 19, 2024
1 parent b9cd100 commit 35dd765
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions napari_plugin_manager/qt_plugin_dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import contextlib
import importlib.metadata
import os
import sys
import webbrowser
from functools import partial
from pathlib import Path
Expand Down Expand Up @@ -326,18 +327,21 @@ def setup_ui(self, enabled=True):
sizePolicy.setRetainSizeWhenHidden(True)
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
self.update_btn.setSizePolicy(sizePolicy)
self.update_btn.clicked.connect(self._update_requested)

# Action Button
self.action_button = QPushButton(self)
self.action_button.setFixedWidth(70)
sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
self.action_button.setSizePolicy(sizePolicy1)
self.action_button.clicked.connect(self._action_requested)

# Cancel
self.cancel_btn = QPushButton("Cancel", self)
self.cancel_btn.setObjectName("remove_button")
self.cancel_btn.setSizePolicy(sizePolicy)
self.cancel_btn.setFixedWidth(70)
self.cancel_btn.clicked.connect(self._cancel_requested)

# Collapsible button
coll_icon = QColoredSVGIcon.from_resources('right_arrow').colored(
Expand Down Expand Up @@ -876,6 +880,8 @@ def __init__(self, parent=None, prefix=None) -> None:
self.refresh()
self._setup_shortcuts()

# region - Private methods
# ------------------------------------------------------------------------
def _quit(self):
self.close()
with contextlib.suppress(AttributeError):
Expand All @@ -894,8 +900,6 @@ def _setup_shortcuts(self):
self._close_shortcut.activated.connect(self.close)
get_settings().appearance.events.theme.connect(self._update_theme)

# region - Private methods
# ------------------------------------------------------------------------
def _update_theme(self, event):
stylesheet = get_current_stylesheet([STYLES_PATH])
self.setStyleSheet(stylesheet)
Expand Down Expand Up @@ -1235,7 +1239,6 @@ def _update_plugin_count(self):
def _install_packages(
self,
packages: Sequence[str] = (),
versions: Optional[Sequence[str]] = None,
):
if not packages:
_packages = self.direct_entry_edit.text()
Expand All @@ -1255,7 +1258,7 @@ def _tag_outdated_plugins(self):
)
self.installed_list.tag_outdated(metadata, is_available_in_conda)

def _add_items(self, items=None):
def _add_items(self):
"""
Add items to the lists by `batch_size` using a timer to add a pause
and prevent freezing the UI.
Expand Down Expand Up @@ -1451,6 +1454,6 @@ def set_prefix(self, prefix):
from qtpy.QtWidgets import QApplication

app = QApplication([])
w = QtPluginDialog()
w.show()
app.exec_()
widget = QtPluginDialog()
widget.exec_()
sys.exit(app.exec_())

Check warning on line 1459 in napari_plugin_manager/qt_plugin_dialog.py

View check run for this annotation

Codecov / codecov/patch

napari_plugin_manager/qt_plugin_dialog.py#L1457-L1459

Added lines #L1457 - L1459 were not covered by tests

0 comments on commit 35dd765

Please sign in to comment.