Skip to content

Commit

Permalink
Use enum.global_enum
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Jan 11, 2025
1 parent 06b34be commit 520d9a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions server/pychess_global_app_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
VARIANTS,
LANGUAGES,
MAX_CHAT_LINES,
MONTHLY,
ARENA,
WEEKLY,
SHIELD,
T_CREATED,
T_STARTED,
SCHEDULE_MAX_DAYS,
ABORTED,
TFreq,
)
from broadcast import round_broadcast
from discord_bot import DiscordBot, FakeDiscordBot
Expand Down Expand Up @@ -383,14 +385,14 @@ def __init_translations(self):
or variant in SEATURDAY
or variant in PAUSED_MONTHLY_VARIANTS
):
tname = translated_tournament_name(variant, TFreq.MONTHLY, ARENA, translation)
self.tourneynames[lang][(variant, TFreq.MONTHLY, ARENA)] = tname
tname = translated_tournament_name(variant, MONTHLY, ARENA, translation)
self.tourneynames[lang][(variant, MONTHLY, ARENA)] = tname
if variant in SEATURDAY or variant in WEEKLY_VARIANTS:
tname = translated_tournament_name(variant, TFreq.WEEKLY, ARENA, translation)
self.tourneynames[lang][(variant, TFreq.WEEKLY, ARENA)] = tname
tname = translated_tournament_name(variant, WEEKLY, ARENA, translation)
self.tourneynames[lang][(variant, WEEKLY, ARENA)] = tname
if variant in SHIELDS:
tname = translated_tournament_name(variant, TFreq.SHIELD, ARENA, translation)
self.tourneynames[lang][(variant, TFreq.SHIELD, ARENA)] = tname
tname = translated_tournament_name(variant, SHIELD, ARENA, translation)
self.tourneynames[lang][(variant, SHIELD, ARENA)] = tname

def __start_bots(self):
rm = self.users["Random-Mover"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import unittest
import datetime as dt

from const import SCHEDULE_MAX_DAYS, SHIELD
from const import SHIELD, SCHEDULE_MAX_DAYS
from scheduler import new_scheduled_tournaments, MONTHLY_VARIANTS, SHIELDS, Scheduler

# Crazhouse960 Shield scheduled at second MONDAY of month
Expand Down

0 comments on commit 520d9a9

Please sign in to comment.