From 0061337b3b71cfa38ceb0c58b459c335dc357a52 Mon Sep 17 00:00:00 2001 From: Natalie Fearnley Date: Tue, 21 May 2024 00:35:46 -0400 Subject: [PATCH] Removed CamelCase TODOs --- sizebot/lib/errors.py | 33 --------------------------------- sizebot/lib/menu.py | 1 - 2 files changed, 34 deletions(-) diff --git a/sizebot/lib/errors.py b/sizebot/lib/errors.py index fb722a11..7f358eb5 100644 --- a/sizebot/lib/errors.py +++ b/sizebot/lib/errors.py @@ -12,11 +12,9 @@ class DigiException(Exception): level = logging.WARNING - # TODO: CamelCase def format_message(self) -> str | None: return None - # TODO: CamelCase def format_user_message(self) -> str | None: return None @@ -30,11 +28,9 @@ def __str__(self) -> str: class DigiContextException(Exception): level = logging.WARNING - # TODO: CamelCase async def format_message(self, ctx: BotContext) -> str | None: return None - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str | None: return None @@ -51,7 +47,6 @@ def __init__(self, guildid: int, userid: int, unreg: bool = False): self.userid = userid self.unreg = unreg - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: user = await ctx.guild.fetch_member(self.userid) usernick = user.display_name @@ -67,17 +62,14 @@ class GuildNotFoundException(DigiException): def __init__(self, guildid: int): self.guildid = guildid - # TODO: CamelCase def format_message(self) -> str: return f"Guild {self.guildid} not found." class ValueIsZeroException(DigiException): - # TODO: CamelCase def format_message(self) -> str: return "Value zero received when unexpected." - # TODO: CamelCase def format_user_message(self) -> str: return ( "Nice try.\n" @@ -85,11 +77,9 @@ def format_user_message(self) -> str: class ValueIsOneException(DigiException): - # TODO: CamelCase def format_message(self) -> str: return "Value one received when unexpected." - # TODO: CamelCase def format_user_message(self) -> str: return ( "Nice try.\n" @@ -103,7 +93,6 @@ class ChangeMethodInvalidException(DigiContextException): def __init__(self, changemethod: str): self.changemethod = changemethod - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: usernick = ctx.author.display_name return f"Sorry, {usernick}! {self.changemethod} is not a valid change method." @@ -112,7 +101,6 @@ async def format_user_message(self, ctx: BotContext) -> str: class CannotSaveWithoutIDException(DigiException): level = logging.CRITICAL - # TODO: CamelCase def format_message(self) -> str: return "Tried to save a user without an ID." @@ -122,7 +110,6 @@ def __init__(self, sizevalue: str, kind: str): self.sizevalue = sizevalue self.kind = kind - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.sizevalue!r} is an unrecognized {self.kind} value." @@ -131,7 +118,6 @@ class InvalidStat(DigiException): def __init__(self, value: str): self.value = value - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.value!r} is an unrecognized stat." @@ -140,7 +126,6 @@ class InvalidStatTag(DigiException): def __init__(self, value: str): self.value = value - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.value!r} is an unrecognized stat tag." @@ -149,7 +134,6 @@ class InvalidObject(DigiException): def __init__(self, name: str): self.name = name - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.name!r} is an unrecognized object." @@ -158,11 +142,9 @@ class InvalidMacrovisionModelException(DigiException): def __init__(self, name: str): self.name = name - # TODO: CamelCase def format_message(self) -> str: return f"{self.name!r} is an unrecognized Macrovision model." - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.name!r} is an unrecognized Macrovision model." @@ -175,11 +157,9 @@ def __init__(self, model: str, view: str): if not macrovision.is_model(model): raise InvalidMacrovisionModelException(self.model) - # TODO: CamelCase def format_message(self) -> str: return f"{self.view!r} is an unrecognized view for the Macrovision model {self.model!r}." - # TODO: CamelCase def format_user_message(self) -> str: return f"{self.view!r} is an unrecognized view for the Macrovision model {self.model!r}." @@ -188,36 +168,30 @@ class InvalidRollException(DigiException): def __init__(self, dString: str): self.dString = dString - # TODO: CamelCase def format_user_message(self) -> str: return f"Invalid roll string `{self.dString}`." class AdminPermissionException(DigiContextException): - # TODO: CamelCase async def format_message(self, ctx: BotContext) -> str: usernick = ctx.author.display_name return f"{usernick} tried to run an admin command." - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: usernick = ctx.author.display_name return f"{usernick} tried to run an admin command. This incident will be reported." class MultilineAsNonFirstCommandException(DigiContextException): - # TODO: CamelCase async def format_message(self, ctx: BotContext) -> str: usernick = ctx.author.display_name return f"{usernick} tried to run a multi-line command in the middle of a sequence." - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: return "You are unable to run a command that takes a multi-line argument in the middle of a batch command sequence. Please try running these commands seperately." class ArgumentException(DigiContextException): - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: return f"Please enter `{ctx.prefix}{ctx.invoked_with} {ctx.command.signature}`." @@ -226,7 +200,6 @@ class UserMessedUpException(DigiContextException): def __init__(self, custommessage: str): self.custommessage = custommessage - # TODO: CamelCase async def format_user_message(self, ctx: BotContext) -> str: return self.custommessage @@ -237,11 +210,9 @@ class ThisShouldNeverHappenException(DigiException): def __init__(self, custommessage: str): self.custommessage = custommessage - # TODO: CamelCase def format_user_message(self) -> str: return "This should never happen. Something very wrong has occured." - # TODO: CamelCase def format_message(self) -> str: return self.custommessage @@ -251,11 +222,9 @@ def __init__(self, s: str, t: str): self.s = s self.t = t - # TODO: CamelCase def format_message(self) -> str: return f"Could not parse {self.s} into a {self.t}." - # TODO: CamelCase def format_user_message(self) -> str: return f"Could not parse {self.s} into a {self.t}." @@ -264,10 +233,8 @@ class UnfoundStatException(DigiException): def __init__(self, s: list[Any]): self.s = utils.sentence_join(getattr(t, "key", repr(t)) for t in s) - # TODO: CamelCase def format_message(self) -> str: return f"Could not calculate the {self.s} stat(s)." - # TODO: CamelCase def format_user_message(self) -> str: return f"Could not calculate the {self.s} stat(s)." diff --git a/sizebot/lib/menu.py b/sizebot/lib/menu.py index a43e4654..58c35819 100644 --- a/sizebot/lib/menu.py +++ b/sizebot/lib/menu.py @@ -10,7 +10,6 @@ class TooManyMenuOptionsException(DigiException): - # TODO: CamelCase def format_message(self) -> str: return "Too many options for this reaction menu. (limit is 20.)"