aboutsummaryrefslogtreecommitdiffstats
path: root/bot/constants.py
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-04-01 09:40:30 +0200
committerGravatar kwzrd <[email protected]>2020-04-01 09:53:05 +0200
commita74debb82dba47ac843ac6b769d8d6d50f3e2f30 (patch)
tree892e5d32a19e572ced60924b672a04025e91b982 /bot/constants.py
parentDeseasonify: yield ints representing days since cycle (diff)
Deseasonify: implement __str__ for Month enum
This way, we can standardize the way Months are shown to both the user and the developer. Note that if passing a Month member to an f-string, the `!s` format code must be specified to ensure our __str__ is used. Co-authored-by: MarkKoz <[email protected]>
Diffstat (limited to 'bot/constants.py')
-rw-r--r--bot/constants.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 22ea9177..638448ea 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -149,6 +149,9 @@ class Month(enum.IntEnum):
NOVEMBER = 11
DECEMBER = 12
+ def __str__(self) -> str:
+ return self.name.title()
+
# If a month override was configured, check that it's a valid Month
# Prevents delaying an exception after the bot starts