diff --git a/pylib/anki/cards.py b/pylib/anki/cards.py index 8bd3464fc..dff8fe32a 100644 --- a/pylib/anki/cards.py +++ b/pylib/anki/cards.py @@ -167,24 +167,24 @@ class Card: def startTimer(self) -> None: self.timerStarted = time.time() - def currentDeckID(self) -> anki.decks.DeckID: + def current_deck_id(self) -> anki.decks.DeckID: return anki.decks.DeckID(self.odid or self.did) def timeLimit(self) -> int: "Time limit for answering in milliseconds." - conf = self.col.decks.confForDid(self.currentDeckID()) + conf = self.col.decks.confForDid(self.current_deck_id()) return conf["maxTaken"] * 1000 def shouldShowTimer(self) -> bool: - conf = self.col.decks.confForDid(self.currentDeckID()) + conf = self.col.decks.confForDid(self.current_deck_id()) return conf["timer"] def replay_question_audio_on_answer_side(self) -> bool: - conf = self.col.decks.confForDid(self.currentDeckID()) + conf = self.col.decks.confForDid(self.current_deck_id()) return conf.get("replayq", True) def autoplay(self) -> bool: - return self.col.decks.confForDid(self.currentDeckID())["autoplay"] + return self.col.decks.confForDid(self.current_deck_id())["autoplay"] def timeTaken(self) -> int: "Time taken to answer card, in integer MS." diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index b0798c27b..d04b2a499 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -398,7 +398,7 @@ class Collection: or current notetype. """ if card := current_review_card: - home_deck = card.currentDeckID() + home_deck = card.current_deck_id() else: home_deck = DeckID(0) diff --git a/pylib/anki/template.py b/pylib/anki/template.py index ed3ce506d..f6a14d08a 100644 --- a/pylib/anki/template.py +++ b/pylib/anki/template.py @@ -172,7 +172,7 @@ class TemplateRenderContext: # add (most) special fields fields["Tags"] = self._note.stringTags().strip() fields["Type"] = self._note_type["name"] - fields["Deck"] = self._col.decks.name(self._card.currentDeckID()) + fields["Deck"] = self._col.decks.name(self._card.current_deck_id()) fields["Subdeck"] = DeckManager.basename(fields["Deck"]) if self._template: fields["Card"] = self._template["name"] diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index a93336c40..9fa4fb79d 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -834,7 +834,7 @@ time = %(time)d; qconnect(a.triggered, func) def onOptions(self) -> None: - self.mw.onDeckConf(self.mw.col.decks.get(self.card.currentDeckID())) + self.mw.onDeckConf(self.mw.col.decks.get(self.card.current_deck_id())) def set_flag_on_current_card(self, desired_flag: int) -> None: # need to toggle off?