mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 09:56:05 -05:00
Bump black to 20.8b1 (and reformat) (#4371)
* Bump black version * Reformat with black
This commit is contained in:
@@ -102,7 +102,9 @@ class AudioAPIInterface:
|
||||
return track
|
||||
|
||||
async def route_tasks(
|
||||
self, action_type: str = None, data: Union[List[MutableMapping], MutableMapping] = None,
|
||||
self,
|
||||
action_type: str = None,
|
||||
data: Union[List[MutableMapping], MutableMapping] = None,
|
||||
) -> None:
|
||||
"""Separate the tasks and run them in the appropriate functions"""
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class YouTubeWrapper:
|
||||
def update_token(self, new_token: Mapping[str, str]):
|
||||
self._token = new_token
|
||||
|
||||
async def _get_api_key(self,) -> str:
|
||||
async def _get_api_key(self) -> str:
|
||||
"""Get the stored youtube token"""
|
||||
if not self._token:
|
||||
self._token = await self.bot.get_shared_api_tokens("youtube")
|
||||
|
||||
@@ -78,12 +78,12 @@ class DpyEvents(MixinMeta, metaclass=CompositeMetaClass):
|
||||
if isinstance(error, commands.ArgParserFailure):
|
||||
handled = True
|
||||
msg = _("`{user_input}` is not a valid value for `{command}`").format(
|
||||
user_input=error.user_input, command=error.cmd,
|
||||
user_input=error.user_input, command=error.cmd
|
||||
)
|
||||
if error.custom_help_msg:
|
||||
msg += f"\n{error.custom_help_msg}"
|
||||
await self.send_embed_msg(
|
||||
ctx, title=_("Unable To Parse Argument"), description=msg, error=True,
|
||||
ctx, title=_("Unable To Parse Argument"), description=msg, error=True
|
||||
)
|
||||
if error.send_cmd_help:
|
||||
await ctx.send_help()
|
||||
@@ -101,7 +101,7 @@ class DpyEvents(MixinMeta, metaclass=CompositeMetaClass):
|
||||
)
|
||||
else:
|
||||
await self.send_embed_msg(
|
||||
ctx, title=_("Invalid Argument"), description=error.args[0], error=True,
|
||||
ctx, title=_("Invalid Argument"), description=error.args[0], error=True
|
||||
)
|
||||
else:
|
||||
await ctx.send_help()
|
||||
|
||||
@@ -146,8 +146,10 @@ class ServerManager:
|
||||
@staticmethod
|
||||
async def _get_java_version() -> Tuple[int, int]:
|
||||
"""This assumes we've already checked that java exists."""
|
||||
_proc: asyncio.subprocess.Process = await asyncio.create_subprocess_exec( # pylint:disable=no-member
|
||||
"java", "-version", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
||||
_proc: asyncio.subprocess.Process = (
|
||||
await asyncio.create_subprocess_exec( # pylint:disable=no-member
|
||||
"java", "-version", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
||||
)
|
||||
)
|
||||
# java -version outputs to stderr
|
||||
_, err = await _proc.communicate()
|
||||
|
||||
Reference in New Issue
Block a user