From a80a1c27fe66848e28257e32dee8a0cbde49b174 Mon Sep 17 00:00:00 2001 From: Myned Date: Mon, 20 Nov 2017 11:28:49 -0500 Subject: [PATCH] Formatting and naming changes --- src/main/cogs/booru.py | 14 +++++++------- src/main/cogs/management.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index d350f6f..d5b8359 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -28,7 +28,7 @@ class MsG: self.LIMIT = 100 self.HISTORY_LIMIT = 150 self.RATE_LIMIT = u.RATE_LIMIT - self.reviqueue = asyncio.Queue() + self.reversiqueue = asyncio.Queue() self.reversifying = False self.updating = False @@ -45,7 +45,7 @@ class MsG: for channel in u.tasks['auto_rev']: temp = self.bot.get_channel(channel) self.bot.loop.create_task(self.queue_for_reversification(temp)) - print('AUTO-REVERSIFYING : #{}'.format(temp.name)) + print('STARTED : auto-reversifying in #{}'.format(temp.name)) self.reversifying = True self.bot.loop.create_task(self._reversify()) # if not self.updating: @@ -124,7 +124,7 @@ class MsG: # self.bot.loop.create_task(self._post()) # self.posting = True # - # print('AUTO-POSTING : #{}'.format(ctx.channel.name)) + # print('STARTED : auto-posting in #{}'.format(ctx.channel.name)) # await ctx.send('**Auto-posting all images in {}**'.format(ctx.channel.mention), delete_after=5) # else: # raise exc.Exists @@ -434,7 +434,7 @@ class MsG: async def _reversify(self): while self.reversifying: - message = await self.reviqueue.get() + message = await self.reversiqueue.get() urls = [] for match in re.finditer('(https?:\/\/[^ ]*\.(?:gif|png|jpg|jpeg))', message.content): @@ -487,9 +487,9 @@ class MsG: return False try: - while not self.bot.is_closed(): + while self.reversifying: message = await self.bot.wait_for('message', check=check) - await self.reviqueue.put(message) + await self.reversiqueue.put(message) await message.add_reaction('\N{HOURGLASS WITH FLOWING SAND}') except exc.Abort: @@ -512,7 +512,7 @@ class MsG: self.bot.loop.create_task(self._reversify()) self.reversifying = True - print('AUTO-REVERSIFYING : #{}'.format(ctx.channel.name)) + print('STARTED : auto-reversifying in #{}'.format(ctx.channel.name)) await ctx.send('**Auto-reversifying all images in** {}'.format(ctx.channel.mention), delete_after=5) else: await ctx.send('**Already auto-reversifying in {}.** Type `stop` to stop.'.format(ctx.channel.mention), delete_after=7) diff --git a/src/main/cogs/management.py b/src/main/cogs/management.py index 2001398..7b38be9 100644 --- a/src/main/cogs/management.py +++ b/src/main/cogs/management.py @@ -24,7 +24,7 @@ class Administration: for channel in u.tasks['auto_del']: temp = self.bot.get_channel(channel) self.bot.loop.create_task(self.queue_for_deletion(temp)) - print('AUTO-DELETING : #{}'.format(temp.name)) + print('STARTED : auto-deleting in #{}'.format(temp.name)) self.deleting = True self.bot.loop.create_task(self.delete()) @@ -164,7 +164,7 @@ class Administration: if not self.deleting: self.bot.loop.create_task(self.delete()) self.deleting = True - print('AUTO-DELETING : #{}'.format(ctx.channel.name)) + print('STARTED : auto-deleting in #{}'.format(ctx.channel.name)) await ctx.send('**Auto-deleting all messages in {}**'.format(ctx.channel.mention), delete_after=5) else: raise exc.Exists