From ea88addc423eaf52cee261ed79cdad261d00a0be Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 18 Mar 2021 14:18:38 -0400 Subject: [PATCH] black refactoring --- ccrole/ccrole.py | 7 ++----- infochannel/infochannel.py | 5 +---- planttycoon/planttycoon.py | 9 ++------- reactrestrict/reactrestrict.py | 7 +------ 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index e3691f8..5d1e40b 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -227,8 +227,7 @@ class CCRole(commands.Cog): if not role_list: return "None" return ", ".join( - discord.utils.get(ctx.guild.roles, id=roleid).name - for roleid in role_list + discord.utils.get(ctx.guild.roles, id=roleid).name for roleid in role_list ) embed.add_field(name="Text", value="```{}```".format(cmd["text"]), inline=False) @@ -325,9 +324,7 @@ class CCRole(commands.Cog): async def eval_cc(self, cmd, message: discord.Message, ctx: commands.Context): """Does all the work""" - if cmd["proles"] and not {role.id for role in message.author.roles} & set( - cmd["proles"] - ): + if cmd["proles"] and not {role.id for role in message.author.roles} & set(cmd["proles"]): log.debug(f"{message.author} missing required role to execute {ctx.invoked_with}") return # Not authorized, do nothing diff --git a/infochannel/infochannel.py b/infochannel/infochannel.py index fe8589f..c196e20 100644 --- a/infochannel/infochannel.py +++ b/infochannel/infochannel.py @@ -67,10 +67,7 @@ class InfoChannel(Cog): default_channel_ids = {k: None for k in self.default_channel_names} # Only members is enabled by default - default_enabled_counts = { - k: k == "members" for k in self.default_channel_names - } - + default_enabled_counts = {k: k == "members" for k in self.default_channel_names} default_guild = { "category_id": None, diff --git a/planttycoon/planttycoon.py b/planttycoon/planttycoon.py index 54d0119..0dbded9 100644 --- a/planttycoon/planttycoon.py +++ b/planttycoon/planttycoon.py @@ -249,7 +249,6 @@ class PlantTycoon(commands.Cog): if gardener.products[product] > 0 ) - degradation = ( 100 / (gardener.current["time"] / 60) @@ -306,9 +305,7 @@ class PlantTycoon(commands.Cog): damage_msg = "You used {} too many times!".format(product) else: damage_msg = "You gave too much of {}.".format(product) - message = "{} Your plant lost some health. :wilted_rose:".format( - damage_msg - ) + message = "{} Your plant lost some health. :wilted_rose:".format(damage_msg) gardener.points += self.defaults["points"]["add_health"] await gardener.save_gardener() elif product in gardener.products or product_category != "tool": @@ -440,9 +437,7 @@ class PlantTycoon(commands.Cog): if not gardener.badges: em.add_field(name="**Badges**", value="None") else: - badges = "".join( - "{}\n".format(badge.capitalize()) for badge in gardener.badges - ) + badges = "".join("{}\n".format(badge.capitalize()) for badge in gardener.badges) em.add_field(name="**Badges**", value=badges) if gardener.products: diff --git a/reactrestrict/reactrestrict.py b/reactrestrict/reactrestrict.py index 8329c46..887d4ab 100644 --- a/reactrestrict/reactrestrict.py +++ b/reactrestrict/reactrestrict.py @@ -97,12 +97,7 @@ class ReactRestrict(Cog): """ current_combos = await self.combo_list() - to_keep = [ - c - for c in current_combos - if c.message_id != message_id or c.role_id != role.id - ] - + to_keep = [c for c in current_combos if c.message_id != message_id or c.role_id != role.id] if to_keep != current_combos: await self.set_combo_list(to_keep)