should(default)deckbedisplayed in snake case
This commit is contained in:
parent
8e15ed7e13
commit
bb86c9dbd6
@ -238,7 +238,7 @@ class DeckManager:
|
|||||||
* default deck has a child (assumed not to be the case if assume_no_child)
|
* default deck has a child (assumed not to be the case if assume_no_child)
|
||||||
"""
|
"""
|
||||||
decks = list(self.decks.values())
|
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]
|
decks = [deck for deck in decks if deck["id"] != 1]
|
||||||
return decks
|
return decks
|
||||||
|
|
||||||
@ -516,7 +516,7 @@ class DeckManager:
|
|||||||
self._recoverOrphans()
|
self._recoverOrphans()
|
||||||
self._checkDeckTree()
|
self._checkDeckTree()
|
||||||
|
|
||||||
def shouldDeckBeDisplayed(
|
def should_deck_be_displayed(
|
||||||
self, deck, force_default: bool = True, assume_no_child: bool = False
|
self, deck, force_default: bool = True, assume_no_child: bool = False
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Whether the deck should appear in main window, browser side list, filter, deck selection...
|
"""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"""
|
True, except for empty default deck without children"""
|
||||||
if deck["id"] != "1":
|
if deck["id"] != "1":
|
||||||
return True
|
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,
|
self,
|
||||||
force_default: bool = True,
|
force_default: bool = True,
|
||||||
assume_no_child: bool = False,
|
assume_no_child: bool = False,
|
||||||
|
@ -1160,7 +1160,7 @@ by clicking on one on the left."""
|
|||||||
did = g[1]
|
did = g[1]
|
||||||
children = g[5]
|
children = g[5]
|
||||||
if str(did) == "1" and not children:
|
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
|
force_default=False, assume_no_child=True
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -1321,7 +1321,7 @@ by clicking on one on the left."""
|
|||||||
subm.addSeparator()
|
subm.addSeparator()
|
||||||
addDecks(subm, children)
|
addDecks(subm, children)
|
||||||
else:
|
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
|
force_default=False, assume_no_child=True
|
||||||
):
|
):
|
||||||
parent.addItem(shortname, self._filterFunc("deck", name))
|
parent.addItem(shortname, self._filterFunc("deck", name))
|
||||||
|
Loading…
Reference in New Issue
Block a user