Remove useless variables

This commit is contained in:
Arthur Milchior 2020-05-11 17:09:22 +02:00
parent 7d8818f855
commit 452daf8d80
7 changed files with 6 additions and 11 deletions

View file

@ -71,8 +71,7 @@ class Collection:
return f"{super().__repr__()} {pprint.pformat(d, width=300)}"
def name(self) -> Any:
n = os.path.splitext(os.path.basename(self.path))[0]
return n
return os.path.splitext(os.path.basename(self.path))[0]
def weakref(self) -> Collection:
"Shortcut to create a weak reference that doesn't break code completion."

View file

@ -322,7 +322,6 @@ class Anki2Importer(Importer):
# does the card's note exist in dst col?
if guid not in self._notes:
continue
dnid = self._notes[guid]
# does the card already exist in the dst col?
ord = card[5]
if (guid, ord) in self._cards:

View file

@ -201,5 +201,4 @@ class CustomStudy(QDialog):
def _getTags(self):
from aqt.taglimit import TagLimit
t = TagLimit(self.mw, self)
return t.tags
return TagLimit(self.mw, self).tags

View file

@ -32,7 +32,7 @@ class DeckChooser(QHBoxLayout):
self.deck = QPushButton(clicked=self.onDeckChange) # type: ignore
self.deck.setAutoDefault(False)
self.deck.setToolTip(shortcut(_("Target Deck (Ctrl+D)")))
s = QShortcut(QKeySequence("Ctrl+D"), self.widget, activated=self.onDeckChange) # type: ignore
QShortcut(QKeySequence("Ctrl+D"), self.widget, activated=self.onDeckChange) # type: ignore
self.addWidget(self.deck)
# starting label
if self.mw.col.conf.get("addToCur", True):

View file

@ -601,8 +601,7 @@ from the profile screen."
newpath = os.path.join(dir, fname)
with open(path, "rb") as f:
data = f.read()
b = self.BackupThread(newpath, data)
b.start()
self.BackupThread(newpath, data).start()
# find existing backups
backups = []

View file

@ -29,7 +29,7 @@ class ModelChooser(QHBoxLayout):
self.models = QPushButton()
# self.models.setStyleSheet("* { text-align: left; }")
self.models.setToolTip(shortcut(_("Change Note Type (Ctrl+N)")))
s = QShortcut(QKeySequence("Ctrl+N"), self.widget, activated=self.onModelChange)
QShortcut(QKeySequence("Ctrl+N"), self.widget, activated=self.onModelChange)
self.models.setAutoDefault(False)
self.addWidget(self.models)
qconnect(self.models.clicked, self.onModelChange)

View file

@ -24,14 +24,13 @@ class LatestVersionFinder(QThread):
self.config = main.pm.meta
def _data(self):
d = {
return {
"ver": versionWithBuild(),
"os": platDesc(),
"id": self.config["id"],
"lm": self.config["lastMsg"],
"crt": self.config["created"],
}
return d
def run(self):
if not self.config["updates"]: