mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Remove useless variables
This commit is contained in:
parent
7d8818f855
commit
452daf8d80
7 changed files with 6 additions and 11 deletions
|
@ -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."
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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 = []
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"]:
|
||||
|
|
Loading…
Reference in a new issue