diff options
author | 2020-03-08 17:36:52 +0100 | |
---|---|---|
committer | 2020-03-08 17:36:52 +0100 | |
commit | dfb9f653cd94079675e6682f78a9fbce5d864e91 (patch) | |
tree | e1765da4d635b85448ab958bbde4f59669733a6f | |
parent | Deseasonify: allow `get_extensions` to find cogs in `seasons` (diff) |
Deseasonify: implement `SeasonBase` for new seasonal system
See class docstring for implementation details.
-rw-r--r-- | bot/seasons/__init__.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bot/seasons/__init__.py b/bot/seasons/__init__.py index 1292485c..21b7f6fe 100644 --- a/bot/seasons/__init__.py +++ b/bot/seasons/__init__.py @@ -1,7 +1,9 @@ import logging import pkgutil from pathlib import Path -from typing import List, Optional, Tuple +from typing import List, Set + +from bot.constants import Month __all__ = ("SeasonBase", "get_seasons", "get_extensions") @@ -42,19 +44,21 @@ def get_extensions() -> List[str]: class SeasonBase: - """Base for Seasonal classes.""" + """ + Base for Seasonal classes. - name: Optional[str] = "evergreen" - bot_name: str = "SeasonalBot" + This serves as the off-season fallback for when no specific + seasons are active. - start_date: Optional[str] = None - end_date: Optional[str] = None - should_announce: bool = False + Seasons are 'registered' by simply by inheriting from `SeasonBase`, + as they are then found by looking at `__subclasses__`. + """ + + season_name: str = "Evergreen" + bot_name: str = "SeasonalBot" - colour: Optional[int] = None - icon: Tuple[str, ...] = ("/logos/logo_full/logo_full.png",) - bot_icon: Optional[str] = None + description: str = "The default season!" - date_format: str = "%d/%m/%Y" + branding_path: str = "seasonal/evergreen" - index: int = 0 + months: Set[Month] = set(Month) |