From 521b0e9e142aa7d0b3564011efeea225d649d491 Mon Sep 17 00:00:00 2001 From: Hk-tang Date: Mon, 23 Mar 2020 11:16:39 -0600 Subject: [PATCH 1/2] Change not not to bool --- qt/aqt/browser.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 4c38a70ec..bb587a78a 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -865,7 +865,7 @@ QTableView {{ gridline-color: {grid} }} def _onRowChanged(self, current, previous) -> None: update = self.updateTitle() show = self.model.cards and update == 1 - self.form.splitter.widget(1).setVisible(not not show) + self.form.splitter.widget(1).setVisible(bool(show)) idx = self.form.tableView.selectionModel().currentIndex() if idx.isValid(): self.card = self.model.getCard(idx) @@ -1660,12 +1660,12 @@ where id in %s""" and self._previewState == "answer" and not self._previewBothSides ) - self._previewPrev.setEnabled(not not (self.singleCard and canBack)) + self._previewPrev.setEnabled(bool(self.singleCard and canBack)) canForward = ( self.currentRow() < self.model.rowCount(None) - 1 or self._previewState == "question" ) - self._previewNext.setEnabled(not not (self.singleCard and canForward)) + self._previewNext.setEnabled(bool(self.singleCard and canForward)) def _closePreview(self): if self._previewWindow: @@ -1925,7 +1925,7 @@ update cards set usn=?, mod=?, did=? where id in """ ###################################################################### def isSuspended(self): - return not not (self.card and self.card.queue == QUEUE_TYPE_SUSPENDED) + return bool(self.card and self.card.queue == QUEUE_TYPE_SUSPENDED) def onSuspend(self): self.editor.saveNow(self._onSuspend) @@ -1986,7 +1986,7 @@ update cards set usn=?, mod=?, did=? where id in """ self.deleteTags(tags="marked", label=False) def isMarked(self): - return not not (self.card and self.card.note().hasTag("Marked")) + return bool(self.card and self.card.note().hasTag("Marked")) # Repositioning ###################################################################### From f4874941c8a1890a57dcac978d979b2a63437fb6 Mon Sep 17 00:00:00 2001 From: Hk-tang Date: Mon, 23 Mar 2020 13:08:50 -0600 Subject: [PATCH 2/2] Added name to contributors --- CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d19694caa..9ed7429b9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -29,6 +29,7 @@ Yoonchae Lee Evandro Coan Alan Du Yuchen Lei +Henry Tang ********************