From e001cd4d3a769b36bdb18f3a883c0f63db1fc239 Mon Sep 17 00:00:00 2001 From: wallgrenen Date: Fri, 8 Jan 2021 20:53:27 +0100 Subject: [PATCH] remove unused variables and commented-out code --- qt/aqt/browser.py | 5 +---- qt/aqt/main.py | 1 - qt/aqt/taglimit.py | 1 - qt/aqt/utils.py | 5 ----- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 3c448f89b..af9c99ade 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -131,7 +131,6 @@ class DataModel(QAbstractTableModel): if role == Qt.FontRole: if self.activeCols[index.column()] not in ("question", "answer", "noteFld"): return - row = index.row() c = self.getCard(index) t = c.template() if not t.get("bfont"): @@ -293,7 +292,6 @@ class DataModel(QAbstractTableModel): return "%Y-%m-%d" def columnData(self, index): - row = index.row() col = index.column() type = self.columnType(col) c = self.getCard(index) @@ -388,7 +386,6 @@ class DataModel(QAbstractTableModel): if type != "noteFld": return False - row = index.row() c = self.getCard(index) nt = c.note().model() return nt["flds"][self.col.models.sortIdx(nt)]["rtl"] @@ -2061,7 +2058,7 @@ where id in %s""" self.model.beginReset() self.mw.checkpoint(tr(TR.BROWSING_TAG_DUPLICATES)) nids = set() - for s, nidlist in res: + for _, nidlist in res: nids.update(nidlist) self.col.tags.bulkAdd(list(nids), tr(TR.BROWSING_DUPLICATE)) self.mw.progress.finish() diff --git a/qt/aqt/main.py b/qt/aqt/main.py index 740cd59e5..1ca0f11f9 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -270,7 +270,6 @@ class AnkiQt(QMainWindow): # called on .clear() return name = self.pm.profiles()[n] - f = self.profileForm self.pm.load(name) def openProfile(self): diff --git a/qt/aqt/taglimit.py b/qt/aqt/taglimit.py index 0fed27f56..cd79dedce 100644 --- a/qt/aqt/taglimit.py +++ b/qt/aqt/taglimit.py @@ -71,7 +71,6 @@ class TagLimit(QDialog): def accept(self): self.hide() - n = 0 # gather yes/no tags yes = [] no = [] diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 373695d3d..f9975e2ca 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -201,16 +201,11 @@ class ButtonedDialog(QMessageBox): self.help = help self.setIcon(QMessageBox.Warning) self.setText(text) - # v = QVBoxLayout() - # v.addWidget(QLabel(text)) - # box = QDialogButtonBox() - # v.addWidget(box) for b in buttons: self._buttons.append(self.addButton(b, QMessageBox.AcceptRole)) if help: self.addButton(tr(TR.ACTIONS_HELP), QMessageBox.HelpRole) buttons.append(tr(TR.ACTIONS_HELP)) - # self.setLayout(v) def run(self): self.exec_()