From dc1146e9e9f87b71c00c63efccd505cbf5b09225 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 11 Aug 2023 09:31:53 -0500 Subject: [PATCH] Update standings command --- cogs/players.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cogs/players.py b/cogs/players.py index b58f572..411087f 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -208,11 +208,11 @@ class Players(commands.Cog): winpct = f'{0:.3f}' else: winpct = f'{stan["wins"] / (stan["wins"] + stan["losses"]):.3f}' - team_string = f'{stan["team"]["abbrev"]: <4} {stan["wins"]: >2}-{stan["losses"]: <2} {winpct} ' + team_string = f'{stan["team"]["abbrev"]: <4} {stan["wins"]: >2}-{stan["losses"]: <2} {winpct} ' if s_type == 'div': - if stan["div_gb"] < 0: - gb = stan["div_gb"] if stan["div_gb"] >= 0.0 else f'+{stan["div_gb"] * -1}' + if stan["div_gb"] is None: + gb = '--' else: gb = stan["div_gb"] team_string += f'{gb: >5}' @@ -227,14 +227,14 @@ class Players(commands.Cog): # This is a division leader - return nothing and continue return '' else: - gb = stan["wc_gb"] if stan["wc_gb"] >= 0.0 else f'+{stan["wc_gb"] * -1}' + gb = stan["wc_gb"] if stan["wc_gb"] >= 0.0 else f'--' if stan["wc_e_num"]: e_num = stan["wc_e_num"] elif stan["wc_e_num"] == 0: e_num = 'E' else: e_num = '--' - team_string += f'{gb: >5} {e_num: >2} ' + team_string += f'{gb: >4} {e_num: >2} ' team_string += f'{stan["run_diff"]: >4}\n' @@ -766,22 +766,22 @@ class Players(commands.Cog): ]) div_four = d4_query['standings'] - div_one_standings = f'```\nTeam W-L PCT GB E# RD\n' + div_one_standings = f'```\nTeam W-L PCT GB E# RD\n' for team in div_one: div_one_standings += self.team_stan_line(team) div_one_standings += f'\n```' - div_two_standings = f'```\nTeam W-L PCT GB E# RD\n' + div_two_standings = f'```\nTeam W-L PCT GB E# RD\n' for team in div_two: div_two_standings += self.team_stan_line(team) div_two_standings += f'\n```' - div_three_standings = f'```\nTeam W-L PCT GB E# RD\n' + div_three_standings = f'```\nTeam W-L PCT GB E# RD\n' for team in div_three: div_three_standings += self.team_stan_line(team) div_three_standings += f'\n```' - div_four_standings = f'```\nTeam W-L PCT GB E# RD\n' + div_four_standings = f'```\nTeam W-L PCT GB E# RD\n' for team in div_four: div_four_standings += self.team_stan_line(team) div_four_standings += f'\n```' @@ -809,7 +809,7 @@ class Players(commands.Cog): # ]) # nl_teams = n_query['standings'] - al_wildcard = f'```\nTeam W-L PCT GB E# RD\n' + al_wildcard = f'```\nTeam W-L PCT GB E# RD\n' for team in al_teams: al_wildcard += self.team_stan_line(team, s_type='wc') al_wildcard += '```'