Skip to content

Commit

Permalink
Revert buggy background operation
Browse files Browse the repository at this point in the history
Partially revert changes from 63f6cc9
  • Loading branch information
zjosua committed Dec 1, 2022
1 parent c9ab803 commit f242aca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pokemanki/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
Version information
"""

__version__ = "1.3.0"
__version__ = "1.3.3"
6 changes: 3 additions & 3 deletions src/pokemanki/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
from .utils import *


def pokemon_display(istagmon: str, wholecollection: bool = True) -> str:
def pokemon_display(decks_or_tags: str, wholecollection: bool = True) -> str:
"""
Control the generation of the html code to display.
:param bool istagmon: True to switch to use tag's displau, False for deck.
:param str decks_or_tags: Whether Pokémon are assigned by decks or by tags.
:param bool wholecollection: True if multiple Pokémon, false if single.
:return: The html text to display.
:rtype: str
Expand All @@ -42,7 +42,7 @@ def pokemon_display(istagmon: str, wholecollection: bool = True) -> str:
# Get list of Pokémon from tags or decks.
# For decks, if wholeCollection, get all assigned Pokémon and assign to Pokémon,
# else, show Pokémon for either single deck or all subdecks and store in Pokémon
if istagmon == "tags":
if decks_or_tags == "tags":
pokemon = TagPokemon()
else:
pokemon = MultiPokemon(wholecollection)
Expand Down
6 changes: 4 additions & 2 deletions src/pokemanki/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .utils import pkmnimgfolder


# global definition of statsDialog for hooks and async callback function
statsDialog = None

tradeclass = object()
Expand Down Expand Up @@ -125,8 +126,9 @@ def build_menu() -> None:
def message_handler(
handled: Tuple[bool, Any], message: str, context: Any
) -> Tuple[bool, Any]:
# context is not set to NewDeckStats, so don't check for it
# maybe Anki bug?
# https://github.com/ankitects/anki/blob/main/qt/tools/genhooks_gui.py#L618
if not type(context) == aqt.stats.NewDeckStats:
return (False, None)
if not message.startswith("Pokemanki#"):
return (False, None)
f = get_synced_conf()["decks_or_tags"]
Expand Down
2 changes: 2 additions & 0 deletions src/pokemanki/pokemanki_css/view_stats.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.pk-st-container {
display: flex;
gap: 15px;
flex-wrap: wrap;
justify-content: center;
padding: 10px;
margin: 10px 0px;
overflow-x: auto;
Expand Down

0 comments on commit f242aca

Please sign in to comment.