mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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)}"
|
return f"{super().__repr__()} {pprint.pformat(d, width=300)}"
|
||||||
|
|
||||||
def name(self) -> Any:
|
def name(self) -> Any:
|
||||||
n = os.path.splitext(os.path.basename(self.path))[0]
|
return os.path.splitext(os.path.basename(self.path))[0]
|
||||||
return n
|
|
||||||
|
|
||||||
def weakref(self) -> Collection:
|
def weakref(self) -> Collection:
|
||||||
"Shortcut to create a weak reference that doesn't break code completion."
|
"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?
|
# does the card's note exist in dst col?
|
||||||
if guid not in self._notes:
|
if guid not in self._notes:
|
||||||
continue
|
continue
|
||||||
dnid = self._notes[guid]
|
|
||||||
# does the card already exist in the dst col?
|
# does the card already exist in the dst col?
|
||||||
ord = card[5]
|
ord = card[5]
|
||||||
if (guid, ord) in self._cards:
|
if (guid, ord) in self._cards:
|
||||||
|
|
|
@ -201,5 +201,4 @@ class CustomStudy(QDialog):
|
||||||
def _getTags(self):
|
def _getTags(self):
|
||||||
from aqt.taglimit import TagLimit
|
from aqt.taglimit import TagLimit
|
||||||
|
|
||||||
t = TagLimit(self.mw, self)
|
return TagLimit(self.mw, self).tags
|
||||||
return t.tags
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class DeckChooser(QHBoxLayout):
|
||||||
self.deck = QPushButton(clicked=self.onDeckChange) # type: ignore
|
self.deck = QPushButton(clicked=self.onDeckChange) # type: ignore
|
||||||
self.deck.setAutoDefault(False)
|
self.deck.setAutoDefault(False)
|
||||||
self.deck.setToolTip(shortcut(_("Target Deck (Ctrl+D)")))
|
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)
|
self.addWidget(self.deck)
|
||||||
# starting label
|
# starting label
|
||||||
if self.mw.col.conf.get("addToCur", True):
|
if self.mw.col.conf.get("addToCur", True):
|
||||||
|
|
|
@ -601,8 +601,7 @@ from the profile screen."
|
||||||
newpath = os.path.join(dir, fname)
|
newpath = os.path.join(dir, fname)
|
||||||
with open(path, "rb") as f:
|
with open(path, "rb") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
b = self.BackupThread(newpath, data)
|
self.BackupThread(newpath, data).start()
|
||||||
b.start()
|
|
||||||
|
|
||||||
# find existing backups
|
# find existing backups
|
||||||
backups = []
|
backups = []
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ModelChooser(QHBoxLayout):
|
||||||
self.models = QPushButton()
|
self.models = QPushButton()
|
||||||
# self.models.setStyleSheet("* { text-align: left; }")
|
# self.models.setStyleSheet("* { text-align: left; }")
|
||||||
self.models.setToolTip(shortcut(_("Change Note Type (Ctrl+N)")))
|
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.models.setAutoDefault(False)
|
||||||
self.addWidget(self.models)
|
self.addWidget(self.models)
|
||||||
qconnect(self.models.clicked, self.onModelChange)
|
qconnect(self.models.clicked, self.onModelChange)
|
||||||
|
|
|
@ -24,14 +24,13 @@ class LatestVersionFinder(QThread):
|
||||||
self.config = main.pm.meta
|
self.config = main.pm.meta
|
||||||
|
|
||||||
def _data(self):
|
def _data(self):
|
||||||
d = {
|
return {
|
||||||
"ver": versionWithBuild(),
|
"ver": versionWithBuild(),
|
||||||
"os": platDesc(),
|
"os": platDesc(),
|
||||||
"id": self.config["id"],
|
"id": self.config["id"],
|
||||||
"lm": self.config["lastMsg"],
|
"lm": self.config["lastMsg"],
|
||||||
"crt": self.config["created"],
|
"crt": self.config["created"],
|
||||||
}
|
}
|
||||||
return d
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.config["updates"]:
|
if not self.config["updates"]:
|
||||||
|
|
Loading…
Reference in a new issue