reformat pep8

pull/5/head
Bobloy 7 years ago
parent 601c362308
commit d88e8040d7

@ -1,11 +1,9 @@
import discord
import os
from collections import defaultdict from collections import defaultdict
from discord.ext import commands
from random import randint from random import randint
from redbot.core import Config, checks, RedContext import discord
from discord.ext import commands
from redbot.core import Config, checks
class Hangman: class Hangman:
@ -20,7 +18,8 @@ class Hangman:
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
self.the_data = defaultdict(lambda:{"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) self.the_data = defaultdict(
lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''})
self.answer_path = "hangman/data/hanganswers.txt" self.answer_path = "hangman/data/hanganswers.txt"
self.winbool = defaultdict(lambda: False) self.winbool = defaultdict(lambda: False)
@ -77,7 +76,6 @@ class Hangman:
|\___ |\___
HAN""", HAN""",
"""> """>
\_________ \_________
|/ | |/ |
@ -89,7 +87,6 @@ class Hangman:
|\___ |\___
HANG""", HANG""",
"""> """>
\_________ \_________
|/ | |/ |
@ -101,8 +98,6 @@ class Hangman:
|\___ |\___
HANGM""", HANGM""",
"""> """>
\________ \________
|/ | |/ |
@ -114,7 +109,6 @@ class Hangman:
|\___ |\___
HANGMA""", HANGMA""",
"""> """>
\________ \________
|/ | |/ |
@ -170,7 +164,6 @@ class Hangman:
else: else:
await self._guessletter(guess, ctx.channel) await self._guessletter(guess, ctx.channel)
def _startgame(self, guild): def _startgame(self, guild):
"""Starts a new game of hangman""" """Starts a new game of hangman"""
self.the_data[guild]["answer"] = self._getphrase().upper() self.the_data[guild]["answer"] = self._getphrase().upper()
@ -250,8 +243,6 @@ class Hangman:
""" Thanks to flapjack reactpoll for guidelines """ Thanks to flapjack reactpoll for guidelines
https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py""" https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py"""
if not self.the_data["trackmessage"]: if not self.the_data["trackmessage"]:
return return
@ -267,7 +258,6 @@ class Hangman:
letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))] letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))]
await self._guessletter(letter, message.channel) await self._guessletter(letter, message.channel)
if str(emoji) in self.navigate: if str(emoji) in self.navigate:
if str(emoji) == self.navigate[0]: if str(emoji) == self.navigate[0]:
await self._reactmessage_am(message) await self._reactmessage_am(message)
@ -275,7 +265,6 @@ class Hangman:
if str(emoji) == self.navigate[-1]: if str(emoji) == self.navigate[-1]:
await self._reactmessage_nz(message) await self._reactmessage_nz(message)
async def _reactmessage_menu(self, message): async def _reactmessage_menu(self, message):
"""React with menu options""" """React with menu options"""
await message.clear_reactions() await message.clear_reactions()
@ -301,7 +290,6 @@ class Hangman:
await message.add_reaction(self.navigate[0]) await message.add_reaction(self.navigate[0])
async def _printgame(self, channel): async def _printgame(self, channel):
"""Print the current state of game""" """Print the current state of game"""
cSay = ("Guess this: " + str(self._hideanswer()) + "\n" cSay = ("Guess this: " + str(self._hideanswer()) + "\n"
@ -321,4 +309,3 @@ def setup(bot):
n = Hangman(bot) n = Hangman(bot)
bot.add_cog(n) bot.add_cog(n)
bot.add_listener(n._on_react, "on_reaction_add") bot.add_listener(n._on_react, "on_reaction_add")

Loading…
Cancel
Save