diff --git a/pylib/anki/decks.py b/pylib/anki/decks.py index c01d25bb9..084dc3238 100644 --- a/pylib/anki/decks.py +++ b/pylib/anki/decks.py @@ -238,7 +238,7 @@ class DeckManager: * default deck has a child (assumed not to be the case if assume_no_child) """ decks = list(self.decks.values()) - if not force_default and not self.shouldDefaultBeDisplayed(force_default): + if not force_default and not self.should_default_be_displayed(force_default): decks = [deck for deck in decks if deck["id"] != 1] return decks @@ -516,7 +516,7 @@ class DeckManager: self._recoverOrphans() self._checkDeckTree() - def shouldDeckBeDisplayed( + def should_deck_be_displayed( self, deck, force_default: bool = True, assume_no_child: bool = False ) -> bool: """Whether the deck should appear in main window, browser side list, filter, deck selection... @@ -524,9 +524,9 @@ class DeckManager: True, except for empty default deck without children""" if deck["id"] != "1": return True - return self.shouldDefaultBeDisplayed(force_default, assume_no_child) + return self.should_default_be_displayed(force_default, assume_no_child) - def shouldDefaultBeDisplayed( + def should_default_be_displayed( self, force_default: bool = True, assume_no_child: bool = False, diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index d48890eff..98832b221 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -1160,7 +1160,7 @@ by clicking on one on the left.""" did = g[1] children = g[5] if str(did) == "1" and not children: - if not self.mw.col.decks.shouldDefaultBeDisplayed( + if not self.mw.col.decks.should_default_be_displayed( force_default=False, assume_no_child=True ): @@ -1321,7 +1321,7 @@ by clicking on one on the left.""" subm.addSeparator() addDecks(subm, children) else: - if did != 1 or self.col.decks.shouldDefaultBeDisplayed( + if did != 1 or self.col.decks.should_default_be_displayed( force_default=False, assume_no_child=True ): parent.addItem(shortname, self._filterFunc("deck", name))