From b54e1c3de82a9844c1167d34da30dc5edb17f6df Mon Sep 17 00:00:00 2001 From: DigiDuncan Date: Sun, 26 Nov 2023 14:53:34 -0500 Subject: [PATCH] format snake case PLEASE --- sizebot/cogs/change.py | 4 ++-- sizebot/lib/proportions.py | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sizebot/cogs/change.py b/sizebot/cogs/change.py index d52f53af..c1e6e470 100644 --- a/sizebot/cogs/change.py +++ b/sizebot/cogs/change.py @@ -131,7 +131,7 @@ async def eatme(self, ctx): userdata = userdb.load(guildid, userid) randmult = round(random.randint(2, 20), 1) - proportions.changeUser(guildid, userid, "multiply", randmult) + proportions.change_user(guildid, userid, "multiply", randmult) await nickmanager.nick_update(ctx.author) userdata = userdb.load(guildid, userid) @@ -156,7 +156,7 @@ async def drinkme(self, ctx): userdata = userdb.load(guildid, userid) randmult = round(random.randint(2, 20), 1) - proportions.changeUser(guildid, ctx.author.id, "divide", randmult) + proportions.change_user(guildid, ctx.author.id, "divide", randmult) await nickmanager.nick_update(ctx.author) userdata = userdb.load(guildid, userid) diff --git a/sizebot/lib/proportions.py b/sizebot/lib/proportions.py index 252b2105..c6d43a58 100644 --- a/sizebot/lib/proportions.py +++ b/sizebot/lib/proportions.py @@ -36,12 +36,12 @@ class Stat: - def __init__(self, name:str, - sets:Optional[str]=None, - userkey:Optional[str]=None, - default_from:Optional[Callable]=None, - power:Optional[int]=None, - requires:list[str]=None): + def __init__(self, name: str, + sets: Optional[str] = None, + userkey: Optional[str] = None, + default_from: Optional[Callable] = None, + power: Optional[int] = None, + requires: list[str] = None): self.sets = sets self.requires = requires or [] self.power = power @@ -56,7 +56,7 @@ def set(self, user): if self.default_from is not None and value is None: value = self.default_from(user.baseheight) return StatValue(self, value) - + def scale_value(self, value, scale): if self.power is None: raise NotImplementedError @@ -70,7 +70,7 @@ def __init__(self, stat: Stat, value: any): def scale(self, scale): return self.stat.scale_value(self.value, scale) - + def __str__(self): return f"{self.stat.name}: {self.value}" @@ -125,11 +125,9 @@ def __str__(self): Stat("Visibility", sets="visibility", requires=["height"], default_from=lambda s: calcVisibility(s["height"])) ] -# allStatValues = [ -# s.set(user) for s in allStats -# ] -def changeUser(guildid: int, userid: int, changestyle: str, amount: SV): + +def change_user(guildid: int, userid: int, changestyle: str, amount: SV): changestyle = changestyle.lower() if changestyle in ["add", "+", "a", "plus"]: changestyle = "add" @@ -977,4 +975,4 @@ def calcVisibility(height: SV): visibility = "a magnifying glass" else: visibility = "only the naked eye" - return visibility \ No newline at end of file + return visibility