diff options
Diffstat (limited to 'bot/seasons')
| -rw-r--r-- | bot/seasons/__init__.py | 19 | ||||
| -rw-r--r-- | bot/seasons/season.py | 10 | 
2 files changed, 15 insertions, 14 deletions
diff --git a/bot/seasons/__init__.py b/bot/seasons/__init__.py index ffbf8add..4f091116 100644 --- a/bot/seasons/__init__.py +++ b/bot/seasons/__init__.py @@ -1,9 +1,20 @@  import logging +import pkgutil +from pathlib import Path +from typing import List -from discord.ext import commands +from bot.seasons.season import SeasonBase -from bot.seasons.season import SeasonBase, get_season - -__all__ = ("SeasonBase", "get_season") +__all__ = ("SeasonBase", "get_seasons")  log = logging.getLogger(__name__) + + +def get_seasons() -> List[str]: +    """Returns all the Season objects located in /bot/seasons/.""" +    seasons = [] + +    for module in pkgutil.iter_modules([Path("bot/seasons")]): +        if module.ispkg: +            seasons.append(module.name) +    return seasons diff --git a/bot/seasons/season.py b/bot/seasons/season.py index c5009d6b..cc2c1251 100644 --- a/bot/seasons/season.py +++ b/bot/seasons/season.py @@ -19,16 +19,6 @@ log = logging.getLogger(__name__)  ICON_BASE_URL = "https://raw.githubusercontent.com/python-discord/branding/master" -def get_seasons() -> List[str]: -    """Returns all the Season objects located in /bot/seasons/.""" -    seasons = [] - -    for module in pkgutil.iter_modules([Path("bot/seasons")]): -        if module.ispkg: -            seasons.append(module.name) -    return seasons - -  class SeasonBase:      """Base class for Seasonal classes."""  |