From 223bef30a5485fc064f8f74cba896b87a311d70f Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 13 Feb 2014 15:09:22 +1300 Subject: [PATCH] pepepepep8 --- plugins/fishbans.py | 1 - plugins/fmylife.py | 8 ++++---- plugins/metacritic.py | 5 ----- plugins/minecraft_bukget.py | 5 +++-- plugins/minecraft_wiki.py | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/plugins/fishbans.py b/plugins/fishbans.py index 26d86c5..7afe5e2 100644 --- a/plugins/fishbans.py +++ b/plugins/fishbans.py @@ -51,6 +51,5 @@ def bancount(inp): if not out: return "The user \x02{}\x02 has no bans.".format(user) else: - # dat string. return "Bans for \x02{}\x02: ".format(user) + ", ".join(out) + ". More info " \ "at {}".format(user_url) diff --git a/plugins/fmylife.py b/plugins/fmylife.py index a25b1a4..1d8c0fa 100644 --- a/plugins/fmylife.py +++ b/plugins/fmylife.py @@ -8,9 +8,9 @@ def refresh_cache(): soup = http.get_soup('http://www.fmylife.com/random/') for e in soup.find_all('div', {'class': 'post article'}): - id = int(e['id']) + fml_id = int(e['id']) text = ''.join(e.find('p').find_all(text=True)) - fml_cache.append((id, text)) + fml_cache.append((fml_id, text)) # do an initial refresh of the cache refresh_cache() @@ -21,9 +21,9 @@ def fml(inp, reply=None): """fml -- Gets a random quote from fmyfife.com.""" # grab the last item in the fml cache and remove it - id, text = fml_cache.pop() + fml_id, text = fml_cache.pop() # reply with the fml we grabbed - reply('(#{}) {}'.format(id, text)) + reply('(#{}) {}'.format(fml_id, text)) # refresh fml cache if its getting empty if len(fml_cache) < 3: refresh_cache() diff --git a/plugins/metacritic.py b/plugins/metacritic.py index eb27114..e32059d 100644 --- a/plugins/metacritic.py +++ b/plugins/metacritic.py @@ -12,12 +12,8 @@ def metacritic(inp): """mc [all|movie|tv|album|x360|ps3|pc|gba|ds|3ds|wii|vita|wiiu|xone|ps4] Gets rating for <title> from metacritic on the specified medium.""" - - # if the results suck, it's metacritic's fault - args = inp.strip() - game_platforms = ('x360', 'ps3', 'pc', 'gba', 'ds', '3ds', 'wii', 'vita', 'wiiu', 'xone', 'ps4') @@ -76,7 +72,6 @@ def metacritic(inp): ''' # get the proper result element we want to pull data from - result = None if not doc.find_class('query_results'): diff --git a/plugins/minecraft_bukget.py b/plugins/minecraft_bukget.py index 3da5675..31895ad 100644 --- a/plugins/minecraft_bukget.py +++ b/plugins/minecraft_bukget.py @@ -13,7 +13,7 @@ details_url = base_url + "plugins/bukkit/{}" categories = http.get_json("http://api.bukget.org/3/categories") count_total = sum([cat["count"] for cat in categories]) -count_categores = {cat["name"].lower() : int(cat["count"]) for cat in categories} # dict conps! +count_categories = {cat["name"].lower() : int(cat["count"]) for cat in categories} # dict comps! class BukgetError(Exception): @@ -99,7 +99,8 @@ def format_output(data): else: line_a = u"\x02{}\x02, by \x02{}\x02 ({}) \x02{}".format(name, authors, stage, url) - line_b = u"Last release: \x02v{}\x02 for \x02{}\x02 at {} \x02{}\x02".format(version_number, bukkit_versions, last_update, link) + line_b = u"Last release: \x02v{}\x02 for \x02{}\x02 at {} \x02{}\x02".format(version_number, bukkit_versions, + last_update, link) return line_a, line_b diff --git a/plugins/minecraft_wiki.py b/plugins/minecraft_wiki.py index e699e7a..878f434 100644 --- a/plugins/minecraft_wiki.py +++ b/plugins/minecraft_wiki.py @@ -21,7 +21,7 @@ def mcwiki(inp): return "No results found." # we remove items with a '/' in the name, because - # gamepedia uses subpages for different languages + # gamepedia uses sub-pages for different languages # for some stupid reason items = [item for item in j[1] if not "/" in item]