mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
format ask_delete_deck method more readable
This commit is contained in:
parent
95a62b20d3
commit
adb8be92a0
1 changed files with 10 additions and 11 deletions
|
@ -283,17 +283,16 @@ class DeckBrowser:
|
||||||
|
|
||||||
def ask_delete_deck(self, did: int) -> bool:
|
def ask_delete_deck(self, did: int) -> bool:
|
||||||
deck = self.mw.col.decks.get(did)
|
deck = self.mw.col.decks.get(did)
|
||||||
extra = None
|
if deck["dyn"]:
|
||||||
if not deck["dyn"]:
|
return True
|
||||||
count = self.mw.col.decks.card_count(did, include_subdecks=True)
|
|
||||||
if count:
|
count = self.mw.col.decks.card_count(did, include_subdecks=True)
|
||||||
extra = tr(TR.DECKS_IT_HAS_CARD, count=count)
|
if not count:
|
||||||
if (
|
return True
|
||||||
deck["dyn"]
|
|
||||||
or not extra
|
extra = tr(TR.DECKS_IT_HAS_CARD, count=count)
|
||||||
or askUser(
|
if askUser(
|
||||||
(tr(TR.DECKS_ARE_YOU_SURE_YOU_WISH_TO, val=deck["name"])) + " " + extra
|
tr(TR.DECKS_ARE_YOU_SURE_YOU_WISH_TO, val=deck["name"]) + " " + extra
|
||||||
)
|
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue