Skip to content

Commit

Permalink
fix stats crash
Browse files Browse the repository at this point in the history
  • Loading branch information
boldandbrad committed Oct 27, 2023
1 parent c23241a commit 9469094
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/meeple/command/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
invalid_collection_error,
warn_msg,
)
from meeple.util.output_util import print_table
from meeple.util.output_util import ItemHeader, print_table


@click.command()
Expand Down Expand Up @@ -103,7 +103,12 @@ def stats(collection_name: str, item_type: str) -> None:
info_msg(
f"Showing average stats for {len(result_items)} of {len(collection.data.items)} items from collection {collection.fmt_name()}."
)
headers = ["Rank", "Rating", "Weight", "Max Players"]
headers = [
ItemHeader.RANK,
ItemHeader.RATING,
ItemHeader.WEIGHT,
ItemHeader.MAX_PLAYERS,
]
rows = [
[
f"{fmt_avg_rank(avg_rank)}",
Expand Down
1 change: 1 addition & 0 deletions src/meeple/util/output_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ItemHeader(Enum):
RATING = ("Rating", "rating", "right")
WEIGHT = ("Weight", "weight", "right")
PLAYERS = ("Players", "players", "right")
MAX_PLAYERS = ("Max Players", "maxplayers", "right")
TIME = ("Play Time", "time", "right")


Expand Down

0 comments on commit 9469094

Please sign in to comment.