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>
This commit is contained in:
parent
7a04f7b5be
commit
a3d09ae288
|
@ -175,7 +175,7 @@ class MainWindow(QMainWindow):
|
||||||
self.queued_container.layout().removeWidget(label)
|
self.queued_container.layout().removeWidget(label)
|
||||||
label.deleteLater()
|
label.deleteLater()
|
||||||
stylesheet = """
|
stylesheet = """
|
||||||
QLabel#QueueWorkerLabel {{
|
QLabel#QueueWorkerLabel {{
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border: 1px solid {br_color};
|
border: 1px solid {br_color};
|
||||||
background-color: {bg_color};
|
background-color: {bg_color};
|
||||||
|
|
|
@ -143,7 +143,7 @@ class QueueGroup(QGroupBox):
|
||||||
self.__container.layout().insertWidget(0, widget)
|
self.__container.layout().insertWidget(0, widget)
|
||||||
if self.count() > 1:
|
if self.count() > 1:
|
||||||
app_name = self.__queue[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))
|
other.toggle_arrows(1, len(self.__queue))
|
||||||
|
|
||||||
def push_back(self, item: InstallQueueItemModel, old_igame: InstalledGame):
|
def push_back(self, item: InstallQueueItemModel, old_igame: InstalledGame):
|
||||||
|
@ -154,7 +154,7 @@ class QueueGroup(QGroupBox):
|
||||||
self.__container.layout().addWidget(widget)
|
self.__container.layout().addWidget(widget)
|
||||||
if self.count() > 1:
|
if self.count() > 1:
|
||||||
app_name = self.__queue[-2]
|
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))
|
other.toggle_arrows(len(self.__queue) - 2, len(self.__queue))
|
||||||
|
|
||||||
def pop_front(self) -> InstallQueueItemModel:
|
def pop_front(self) -> InstallQueueItemModel:
|
||||||
|
@ -173,12 +173,12 @@ class QueueGroup(QGroupBox):
|
||||||
for idx in [0, 1]:
|
for idx in [0, 1]:
|
||||||
if self.count() > idx:
|
if self.count() > idx:
|
||||||
app_name = self.__queue[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))
|
widget.toggle_arrows(idx, len(self.__queue))
|
||||||
for idx in [1, 2]:
|
for idx in [1, 2]:
|
||||||
if self.count() > idx:
|
if self.count() > idx:
|
||||||
app_name = self.__queue[-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))
|
widget.toggle_arrows(len(self.__queue) - idx, len(self.__queue))
|
||||||
|
|
||||||
def __remove(self, app_name: str):
|
def __remove(self, app_name: str):
|
||||||
|
|
|
@ -189,8 +189,8 @@ class EGLSyncListItem(QListWidgetItem):
|
||||||
return self.checkState() == Qt.Checked
|
return self.checkState() == Qt.Checked
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def action(self) -> Union[str,bool]:
|
def action(self) -> Union[str, bool]:
|
||||||
...
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def app_name(self):
|
def app_name(self):
|
||||||
|
@ -199,7 +199,7 @@ class EGLSyncListItem(QListWidgetItem):
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def app_title(self) -> str:
|
def app_title(self) -> str:
|
||||||
...
|
pass
|
||||||
|
|
||||||
|
|
||||||
class EGLSyncExportItem(EGLSyncListItem):
|
class EGLSyncExportItem(EGLSyncListItem):
|
||||||
|
@ -279,12 +279,12 @@ class EGLSyncListGroup(QGroupBox):
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def action(self):
|
def action(self):
|
||||||
...
|
pass
|
||||||
|
|
||||||
@pyqtSlot(list)
|
@pyqtSlot(list)
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def show_errors(self, errors: List):
|
def show_errors(self, errors: List):
|
||||||
...
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def items(self) -> Iterable[EGLSyncListItem]:
|
def items(self) -> Iterable[EGLSyncListItem]:
|
||||||
|
|
|
@ -431,7 +431,6 @@ class RareGame(RareGameSlim):
|
||||||
ret = False
|
ret = False
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def needs_verification(self) -> bool:
|
def needs_verification(self) -> bool:
|
||||||
"""!
|
"""!
|
||||||
|
@ -633,7 +632,6 @@ class RareGame(RareGameSlim):
|
||||||
if ask_sync_saves:
|
if ask_sync_saves:
|
||||||
args.extend("--ask-sync-saves")
|
args.extend("--ask-sync-saves")
|
||||||
|
|
||||||
# kill me, if I don't change it before commit
|
|
||||||
QProcess.startDetached(executable, args)
|
QProcess.startDetached(executable, args)
|
||||||
logger.info(f"Start new Process: ({executable} {' '.join(args)})")
|
logger.info(f"Start new Process: ({executable} {' '.join(args)})")
|
||||||
self.game_process.connect_to_server(on_startup=False)
|
self.game_process.connect_to_server(on_startup=False)
|
||||||
|
|
|
@ -42,19 +42,19 @@ class CollapsibleBase(object):
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def isChecked(self) -> bool:
|
def isChecked(self) -> bool:
|
||||||
...
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def click(self) -> None:
|
def click(self) -> None:
|
||||||
...
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def addToLayout(self, widget: QWidget) -> None:
|
def addToLayout(self, widget: QWidget) -> None:
|
||||||
...
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def sizeHint(self) -> QSize:
|
def sizeHint(self) -> QSize:
|
||||||
...
|
pass
|
||||||
|
|
||||||
def animationStart(self, checked):
|
def animationStart(self, checked):
|
||||||
direction = QAbstractAnimation.Forward if checked else QAbstractAnimation.Backward
|
direction = QAbstractAnimation.Forward if checked else QAbstractAnimation.Backward
|
||||||
|
|
Loading…
Reference in a new issue