From a3d09ae288b36de8f2810409bc3bb24ee4b72db7 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Mon, 20 Feb 2023 15:31:04 +0200 Subject: [PATCH] Code cleanup: Use `pass` instead of ellipsis (`...`) for `abstractmethod`s Fix a few other issues pointed out by MultisampledNight Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com> --- rare/components/main_window.py | 2 +- rare/components/tabs/downloads/groups.py | 8 ++++---- .../tabs/games/integrations/egl_sync_group.py | 10 +++++----- rare/models/game.py | 2 -- rare/widgets/collapsible_widget.py | 8 ++++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/rare/components/main_window.py b/rare/components/main_window.py index cc8f3b15..80c378af 100644 --- a/rare/components/main_window.py +++ b/rare/components/main_window.py @@ -175,7 +175,7 @@ class MainWindow(QMainWindow): self.queued_container.layout().removeWidget(label) label.deleteLater() stylesheet = """ - QLabel#QueueWorkerLabel {{ + QLabel#QueueWorkerLabel {{ border-radius: 3px; border: 1px solid {br_color}; background-color: {bg_color}; diff --git a/rare/components/tabs/downloads/groups.py b/rare/components/tabs/downloads/groups.py index ef5babb9..cd0869db 100644 --- a/rare/components/tabs/downloads/groups.py +++ b/rare/components/tabs/downloads/groups.py @@ -143,7 +143,7 @@ class QueueGroup(QGroupBox): self.__container.layout().insertWidget(0, widget) if self.count() > 1: app_name = self.__queue[1] - other: QueueWidget = self.__find_widget(app_name) + other: QueueWidget = self.__find_widget(app_name) other.toggle_arrows(1, len(self.__queue)) def push_back(self, item: InstallQueueItemModel, old_igame: InstalledGame): @@ -154,7 +154,7 @@ class QueueGroup(QGroupBox): self.__container.layout().addWidget(widget) if self.count() > 1: app_name = self.__queue[-2] - other: QueueWidget = self.__find_widget(app_name) + other: QueueWidget = self.__find_widget(app_name) other.toggle_arrows(len(self.__queue) - 2, len(self.__queue)) def pop_front(self) -> InstallQueueItemModel: @@ -173,12 +173,12 @@ class QueueGroup(QGroupBox): for idx in [0, 1]: if self.count() > idx: app_name = self.__queue[idx] - widget: QueueWidget = self.__find_widget(app_name) + widget: QueueWidget = self.__find_widget(app_name) widget.toggle_arrows(idx, len(self.__queue)) for idx in [1, 2]: if self.count() > idx: app_name = self.__queue[-idx] - widget: QueueWidget = self.__find_widget(app_name) + widget: QueueWidget = self.__find_widget(app_name) widget.toggle_arrows(len(self.__queue) - idx, len(self.__queue)) def __remove(self, app_name: str): diff --git a/rare/components/tabs/games/integrations/egl_sync_group.py b/rare/components/tabs/games/integrations/egl_sync_group.py index 9df5ee80..0b55d3b9 100644 --- a/rare/components/tabs/games/integrations/egl_sync_group.py +++ b/rare/components/tabs/games/integrations/egl_sync_group.py @@ -189,8 +189,8 @@ class EGLSyncListItem(QListWidgetItem): return self.checkState() == Qt.Checked @abstractmethod - def action(self) -> Union[str,bool]: - ... + def action(self) -> Union[str, bool]: + pass @property def app_name(self): @@ -199,7 +199,7 @@ class EGLSyncListItem(QListWidgetItem): @property @abstractmethod def app_title(self) -> str: - ... + pass class EGLSyncExportItem(EGLSyncListItem): @@ -279,12 +279,12 @@ class EGLSyncListGroup(QGroupBox): @abstractmethod def action(self): - ... + pass @pyqtSlot(list) @abstractmethod def show_errors(self, errors: List): - ... + pass @property def items(self) -> Iterable[EGLSyncListItem]: diff --git a/rare/models/game.py b/rare/models/game.py index c09e4685..93969045 100644 --- a/rare/models/game.py +++ b/rare/models/game.py @@ -431,7 +431,6 @@ class RareGame(RareGameSlim): ret = False return ret - @property def needs_verification(self) -> bool: """! @@ -633,7 +632,6 @@ class RareGame(RareGameSlim): if ask_sync_saves: args.extend("--ask-sync-saves") - # kill me, if I don't change it before commit QProcess.startDetached(executable, args) logger.info(f"Start new Process: ({executable} {' '.join(args)})") self.game_process.connect_to_server(on_startup=False) diff --git a/rare/widgets/collapsible_widget.py b/rare/widgets/collapsible_widget.py index ae9fb04e..86ce6969 100644 --- a/rare/widgets/collapsible_widget.py +++ b/rare/widgets/collapsible_widget.py @@ -42,19 +42,19 @@ class CollapsibleBase(object): @abstractmethod def isChecked(self) -> bool: - ... + pass @abstractmethod def click(self) -> None: - ... + pass @abstractmethod def addToLayout(self, widget: QWidget) -> None: - ... + pass @abstractmethod def sizeHint(self) -> QSize: - ... + pass def animationStart(self, checked): direction = QAbstractAnimation.Forward if checked else QAbstractAnimation.Backward