aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-03-07 13:30:10 +0100
committerGravatar kwzrd <[email protected]>2020-03-07 13:30:10 +0100
commitca505373da09bf722d2b0511f93401a07805eae7 (patch)
tree112f89dc218399b23697c167f7ecd17768c2b6f9
parentDeseasonify: add `get_extensions` helper function (diff)
Deseasonify: move 'SeasonBase' to seasons package init
The season module can now be safely deleted, as everything defined here has either been removed or moved elsewhere.
-rw-r--r--bot/seasons/__init__.py23
-rw-r--r--bot/seasons/season.py38
2 files changed, 20 insertions, 41 deletions
diff --git a/bot/seasons/__init__.py b/bot/seasons/__init__.py
index af270901..1569f29a 100644
--- a/bot/seasons/__init__.py
+++ b/bot/seasons/__init__.py
@@ -1,9 +1,7 @@
import logging
import pkgutil
from pathlib import Path
-from typing import List
-
-from bot.seasons.season import SeasonBase
+from typing import List, Optional, Tuple
__all__ = ("SeasonBase", "get_seasons", "get_extensions")
@@ -37,3 +35,22 @@ def get_extensions() -> List[str]:
extensions.append(f"bot.seasons.{package.name}.{module.name}")
return extensions
+
+
+class SeasonBase:
+ """Base for Seasonal classes."""
+
+ name: Optional[str] = "evergreen"
+ bot_name: str = "SeasonalBot"
+
+ start_date: Optional[str] = None
+ end_date: Optional[str] = None
+ should_announce: bool = False
+
+ colour: Optional[int] = None
+ icon: Tuple[str, ...] = ("/logos/logo_full/logo_full.png",)
+ bot_icon: Optional[str] = None
+
+ date_format: str = "%d/%m/%Y"
+
+ index: int = 0
diff --git a/bot/seasons/season.py b/bot/seasons/season.py
deleted file mode 100644
index cc2c1251..00000000
--- a/bot/seasons/season.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import contextlib
-import datetime
-import importlib
-import inspect
-import logging
-import pkgutil
-from pathlib import Path
-from typing import List, Optional, Tuple, Type, Union
-
-import discord
-from discord.ext import commands
-
-from bot.bot import bot
-from bot.constants import Channels, Client, Roles
-from bot.decorators import with_role
-
-log = logging.getLogger(__name__)
-
-ICON_BASE_URL = "https://raw.githubusercontent.com/python-discord/branding/master"
-
-
-class SeasonBase:
- """Base class for Seasonal classes."""
-
- name: Optional[str] = "evergreen"
- bot_name: str = "SeasonalBot"
-
- start_date: Optional[str] = None
- end_date: Optional[str] = None
- should_announce: bool = False
-
- colour: Optional[int] = None
- icon: Tuple[str, ...] = ("/logos/logo_full/logo_full.png",)
- bot_icon: Optional[str] = None
-
- date_format: str = "%d/%m/%Y"
-
- index: int = 0