[V3] Update code standards (black code format pass) (#1650)

* ran black: code formatter against `redbot/` with `-l 99`

* badge
This commit is contained in:
Michael H
2018-05-14 15:33:24 -04:00
committed by Will
parent e7476edd68
commit b88b5a2601
90 changed files with 3629 additions and 3223 deletions

View File

@@ -7,7 +7,7 @@ from redbot.core.i18n import Translator, cog_i18n
from redbot.cogs.dataconverter.core_specs import SpecResolver
from redbot.core.utils.chat_formatting import box
_ = Translator('DataConverter', __file__)
_ = Translator("DataConverter", __file__)
@cog_i18n(_)
@@ -34,13 +34,14 @@ class DataConverter:
if not resolver.available:
return await ctx.send(
_("There don't seem to be any data files I know how to "
"handle here. Are you sure you gave me the base "
"installation path?")
_(
"There don't seem to be any data files I know how to "
"handle here. Are you sure you gave me the base "
"installation path?"
)
)
while resolver.available:
menu = _("Please select a set of data to import by number"
", or 'exit' to exit")
menu = _("Please select a set of data to import by number" ", or 'exit' to exit")
for index, entry in enumerate(resolver.available, 1):
menu += "\n{}. {}".format(index, entry)
@@ -50,24 +51,17 @@ class DataConverter:
return m.channel == ctx.channel and m.author == ctx.author
try:
message = await self.bot.wait_for(
'message', check=pred, timeout=60
)
message = await self.bot.wait_for("message", check=pred, timeout=60)
except asyncio.TimeoutError:
return await ctx.send(
_('Try this again when you are more ready'))
return await ctx.send(_("Try this again when you are more ready"))
else:
if message.content.strip().lower() in [
'quit', 'exit', '-1', 'q', 'cancel'
]:
if message.content.strip().lower() in ["quit", "exit", "-1", "q", "cancel"]:
return await ctx.tick()
try:
message = int(message.content.strip())
to_conv = resolver.available[message - 1]
except (ValueError, IndexError):
await ctx.send(
_("That wasn't a valid choice.")
)
await ctx.send(_("That wasn't a valid choice."))
continue
else:
async with ctx.typing():
@@ -76,6 +70,8 @@ class DataConverter:
await menu_message.delete()
else:
return await ctx.send(
_("There isn't anything else I know how to convert here."
"\nThere might be more things I can convert in the future.")
_(
"There isn't anything else I know how to convert here."
"\nThere might be more things I can convert in the future."
)
)