mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Remove redundant camelcase aliases (#1509)
This commit is contained in:
parent
b9eccec2b0
commit
627f910635
7 changed files with 9 additions and 12 deletions
|
@ -344,9 +344,6 @@ class Collection(DeprecatedNamesMixin):
|
||||||
Unlike note.flush(), this will invalidate any current checkpoint."""
|
Unlike note.flush(), this will invalidate any current checkpoint."""
|
||||||
return self.update_notes([note])
|
return self.update_notes([note])
|
||||||
|
|
||||||
getCard = get_card
|
|
||||||
getNote = get_note
|
|
||||||
|
|
||||||
# Utils
|
# Utils
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ class TextCardExporter(Exporter):
|
||||||
|
|
||||||
out = ""
|
out = ""
|
||||||
for cid in ids:
|
for cid in ids:
|
||||||
c = self.col.getCard(cid)
|
c = self.col.get_card(cid)
|
||||||
out += esc(c.question())
|
out += esc(c.question())
|
||||||
out += "\t" + esc(c.answer()) + "\n"
|
out += "\t" + esc(c.answer()) + "\n"
|
||||||
file.write(out.encode("utf-8"))
|
file.write(out.encode("utf-8"))
|
||||||
|
|
|
@ -120,7 +120,7 @@ class Note(DeprecatedNamesMixin):
|
||||||
return card
|
return card
|
||||||
|
|
||||||
def cards(self) -> list[anki.cards.Card]:
|
def cards(self) -> list[anki.cards.Card]:
|
||||||
return [self.col.getCard(id) for id in self.card_ids()]
|
return [self.col.get_card(id) for id in self.card_ids()]
|
||||||
|
|
||||||
def card_ids(self) -> Sequence[anki.cards.CardId]:
|
def card_ids(self) -> Sequence[anki.cards.CardId]:
|
||||||
return self.col.card_ids_of_note(self.id)
|
return self.col.card_ids_of_note(self.id)
|
||||||
|
|
|
@ -191,7 +191,7 @@ class Scheduler(SchedulerBaseWithLegacy):
|
||||||
def _getNewCard(self) -> Card | None:
|
def _getNewCard(self) -> Card | None:
|
||||||
if self._fillNew():
|
if self._fillNew():
|
||||||
self.newCount -= 1
|
self.newCount -= 1
|
||||||
return self.col.getCard(self._newQueue.pop())
|
return self.col.get_card(self._newQueue.pop())
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _updateNewCardRatio(self) -> None:
|
def _updateNewCardRatio(self) -> None:
|
||||||
|
@ -342,7 +342,7 @@ limit %d"""
|
||||||
cutoff += self.col.conf["collapseTime"]
|
cutoff += self.col.conf["collapseTime"]
|
||||||
if self._lrnQueue[0][0] < cutoff:
|
if self._lrnQueue[0][0] < cutoff:
|
||||||
id = heappop(self._lrnQueue)[1]
|
id = heappop(self._lrnQueue)[1]
|
||||||
card = self.col.getCard(id)
|
card = self.col.get_card(id)
|
||||||
self.lrnCount -= 1
|
self.lrnCount -= 1
|
||||||
return card
|
return card
|
||||||
return None
|
return None
|
||||||
|
@ -381,7 +381,7 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""",
|
||||||
def _getLrnDayCard(self) -> Card | None:
|
def _getLrnDayCard(self) -> Card | None:
|
||||||
if self._fillLrnDay():
|
if self._fillLrnDay():
|
||||||
self.lrnCount -= 1
|
self.lrnCount -= 1
|
||||||
return self.col.getCard(self._lrnDayQueue.pop())
|
return self.col.get_card(self._lrnDayQueue.pop())
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Fetching reviews
|
# Fetching reviews
|
||||||
|
@ -442,7 +442,7 @@ limit ?"""
|
||||||
def _getRevCard(self) -> Card | None:
|
def _getRevCard(self) -> Card | None:
|
||||||
if self._fillRev():
|
if self._fillRev():
|
||||||
self.revCount -= 1
|
self.revCount -= 1
|
||||||
return self.col.getCard(self._revQueue.pop())
|
return self.col.get_card(self._revQueue.pop())
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Answering a card
|
# Answering a card
|
||||||
|
|
|
@ -318,7 +318,7 @@ def test_supermemo_xml_01_unicode():
|
||||||
i.run()
|
i.run()
|
||||||
assert i.total == 1
|
assert i.total == 1
|
||||||
cid = col.db.scalar("select id from cards")
|
cid = col.db.scalar("select id from cards")
|
||||||
c = col.getCard(cid)
|
c = col.get_card(cid)
|
||||||
# Applies A Factor-to-E Factor conversion
|
# Applies A Factor-to-E Factor conversion
|
||||||
assert c.factor == 2879
|
assert c.factor == 2879
|
||||||
assert c.reps == 7
|
assert c.reps == 7
|
||||||
|
|
|
@ -70,7 +70,7 @@ def _legacy_undo(*, parent: QWidget) -> None:
|
||||||
if reviewing:
|
if reviewing:
|
||||||
# push the undone card to the top of the queue
|
# push the undone card to the top of the queue
|
||||||
cid = result.card.id
|
cid = result.card.id
|
||||||
card = mw.col.getCard(cid)
|
card = mw.col.get_card(cid)
|
||||||
mw.reviewer.cardQueue.append(card)
|
mw.reviewer.cardQueue.append(card)
|
||||||
|
|
||||||
gui_hooks.review_did_undo(cid)
|
gui_hooks.review_did_undo(cid)
|
||||||
|
|
|
@ -147,7 +147,7 @@ class Reviewer:
|
||||||
if self._answeredIds:
|
if self._answeredIds:
|
||||||
if not self.card or self._answeredIds[-1] != self.card.id:
|
if not self.card or self._answeredIds[-1] != self.card.id:
|
||||||
try:
|
try:
|
||||||
return self.mw.col.getCard(self._answeredIds[-1])
|
return self.mw.col.get_card(self._answeredIds[-1])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# id was deleted
|
# id was deleted
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue