From 4c81ea239386f90f0805da113c01aedfc7c42e4a Mon Sep 17 00:00:00 2001 From: flare - Jamie Date: Fri, 7 Jun 2019 15:26:16 +0100 Subject: [PATCH] Clarify some docstrings. --- .gitignore | 4 ++-- Makefile | 21 +++++++++++++++++++++ highlight/highlight.py | 18 ++++++++++++++---- modmail/modmail.py | 10 +++++----- r6/info.json | 1 + 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index c2e6e01e..56682757 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,8 @@ venv/ rainbow6/r6.png foco/ wcrp/ -make.bat -Makefile +privatecogs/ mrp/ sampservers/ .vscode/launch.json +epl/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..c42b3652 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Python Code Style +reformat: + black -l 99 `git ls-files "*.py"` +stylecheck: + black --check -l 99 -N `git ls-files "*.py"` + +# Translations +gettext: + redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*" +upload_translations: + $(MAKE) gettext + crowdin upload sources +download_translations: + crowdin download + +# Vendoring +REF?=rewrite +update_vendor: + pip install --upgrade --no-deps -t . https://github.com/Rapptz/discord.py/archive/$(REF).tar.gz#egg=discord.py + rm -r discord.py*-info + $(MAKE) reformat diff --git a/highlight/highlight.py b/highlight/highlight.py index 77a9b43f..750e8130 100644 --- a/highlight/highlight.py +++ b/highlight/highlight.py @@ -97,10 +97,14 @@ async def toggle(self, ctx, state: bool): async with self.config.channel(ctx.channel).toggle() as toggle: if state: toggle[f"{ctx.author.id}"] = state - await ctx.send("You've enabled highlighting on this channel.") + await ctx.send( + "{} has enabled their highlighting on this channel.".format(ctx.author.name) + ) elif not state: toggle[f"{ctx.author.id}"] = state - await ctx.send("You've disabled highlighting on this channel.") + await ctx.send( + "{} has enabled their highlighting on this channel.".format(ctx.author.name) + ) @highlight.command() async def bots(self, ctx, state: bool): @@ -108,10 +112,16 @@ async def bots(self, ctx, state: bool): async with self.config.channel(ctx.channel).ignore() as ignore: if state: ignore[f"{ctx.author.id}"] = state - await ctx.send("Bots messages will now be included in highlighted messages") + await ctx.send( + "Bots messages will now be included in {}'s highlighted messages".format( + ctx.author.name + ) + ) elif not state: ignore[f"{ctx.author.id}"] = state - await ctx.send("Bot messages will not longer be highlighted.") + await ctx.send( + "Bot messages will not longer be highlighted for {}.".format(ctx.author.name) + ) @highlight.command() async def list(self, ctx, channel: Optional[discord.TextChannel] = None): diff --git a/modmail/modmail.py b/modmail/modmail.py index 85e1347f..ca2e2b74 100644 --- a/modmail/modmail.py +++ b/modmail/modmail.py @@ -141,7 +141,7 @@ async def list(self, ctx): @modmailset.command() async def toggle(self, ctx, mode: bool): - """Toggle modmail.""" + """Toggle modmail on the current channel.""" async with self.config.toggle() as toggle: if mode: toggle["status"] = True @@ -152,9 +152,9 @@ async def toggle(self, ctx, mode: bool): @modmailset.command() async def dms(self, ctx, mode: bool): - """Toggle modmail forwarding from DMs - True - Allow DM Forwarding - False - Disallow DM Forwarding""" + """Toggle modmail forwarding from DMs. + True - Allow DM Forwarding. + False - Disallow DM Forwarding.""" async with self.config.toggle() as toggle: if mode: toggle["dms"] = True @@ -165,7 +165,7 @@ async def dms(self, ctx, mode: bool): @modmailset.command() async def respond(self, ctx, mode: bool): - """Toggle responding to modmail""" + """Toggle responding to modmail.""" async with self.config.toggle() as toggle: if mode: toggle["respond"] = True diff --git a/r6/info.json b/r6/info.json index 8ea7a0f6..103622fc 100644 --- a/r6/info.json +++ b/r6/info.json @@ -6,5 +6,6 @@ "short": "Show R6 player info", "description": "List R6 stats from whatever season and/or operator stats etc.", "tags": ["r6", "stats", "operators"], + "requirements": ["pillow"], "hidden": true }