[V3] Update black version and reformat (#1745)

* Update black version and reformat

* Pin black in extras_require
This commit is contained in:
Tobotimus
2018-05-30 12:37:00 +10:00
committed by palmtree5
parent d8c4113d24
commit 14cc701b25
32 changed files with 27 additions and 54 deletions

View File

@@ -4,7 +4,6 @@ __all__ = ["Config", "__version__"]
class VersionInfo:
def __init__(self, major, minor, micro, releaselevel, serial):
self._levels = ["alpha", "beta", "final"]
self.major = major

View File

@@ -16,7 +16,6 @@ async def check_overrides(ctx, *, level):
def is_owner(**kwargs):
async def check(ctx):
override = await check_overrides(ctx, level="owner")
return override if override is not None else await ctx.bot.is_owner(ctx.author, **kwargs)
@@ -73,7 +72,6 @@ async def is_admin_or_superior(ctx):
def mod_or_permissions(**perms):
async def predicate(ctx):
override = await check_overrides(ctx, level="mod")
return (
@@ -86,7 +84,6 @@ def mod_or_permissions(**perms):
def admin_or_permissions(**perms):
async def predicate(ctx):
override = await check_overrides(ctx, level="admin")
return (
@@ -99,7 +96,6 @@ def admin_or_permissions(**perms):
def bot_in_a_guild(**kwargs):
async def predicate(ctx):
return len(ctx.bot.guilds) > 0
@@ -107,7 +103,6 @@ def bot_in_a_guild(**kwargs):
def guildowner_or_permissions(**perms):
async def predicate(ctx):
has_perms_or_is_owner = await check_permissions(ctx, perms)
if ctx.guild is None:

View File

@@ -55,6 +55,7 @@ class Group(Command, commands.Group):
This class inherits from `discord.ext.commands.Group`, with `Command` mixed
in.
"""
pass

View File

@@ -441,6 +441,7 @@ class Config:
attempting to access data.
"""
GLOBAL = "GLOBAL"
GUILD = "GUILD"
CHANNEL = "TEXTCHANNEL"

View File

@@ -2,7 +2,6 @@ __all__ = ["BaseDriver"]
class BaseDriver:
def __init__(self, cog_name, identifier):
self.cog_name = cog_name
self.unique_cog_identifier = identifier

View File

@@ -49,7 +49,6 @@ def should_log_sentry(exception) -> bool:
def init_events(bot, cli_flags):
@bot.event
async def on_connect():
if bot.uptime is None:

View File

@@ -3,7 +3,6 @@ from . import commands
def init_global_checks(bot):
@bot.check
async def global_perms(ctx):
"""Check the user is/isn't globally whitelisted/blacklisted."""

View File

@@ -89,7 +89,6 @@ methods = Methods()
class BaseRPCMethodMixin:
def __init__(self):
methods.add(self.all_methods, name="all_methods")

View File

@@ -18,6 +18,7 @@ class AntiSpam:
Where quantity represents the maximum amount of times
something should be allowed in an interval.
"""
# TODO : Decorator interface for command check using `spammy`
# with insertion of the antispam element into context
# for manual stamping on succesful command completion