diff --git a/disabled_stuff/mygengo_translate.py b/disabled_stuff/mygengo_translate.py index d61ab14..6e7b006 100644 --- a/disabled_stuff/mygengo_translate.py +++ b/disabled_stuff/mygengo_translate.py @@ -1,7 +1,7 @@ # BING translation plugin by Lukeroge and neersighted from util import hook from util import http -import re +import re import htmlentitydefs import mygengo diff --git a/plugins/minecraft_bukget.py b/plugins/minecraft_bukget.py index 31895ad..1222020 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_categories = {cat["name"].lower() : int(cat["count"]) for cat in categories} # dict comps! +count_categories = {cat["name"].lower(): int(cat["count"]) for cat in categories} # dict comps! class BukgetError(Exception): @@ -88,7 +88,7 @@ def format_output(data): current_version = data['versions'][0] last_update = time.strftime('%d %B %Y %H:%M', - time.gmtime(current_version['date'])) + time.gmtime(current_version['date'])) version_number = data['versions'][0]['version'] bukkit_versions = ", ".join(current_version['game_versions']) diff --git a/plugins/minecraft_items.py b/plugins/minecraft_items.py index 97a6420..2031b14 100644 --- a/plugins/minecraft_items.py +++ b/plugins/minecraft_items.py @@ -42,29 +42,29 @@ with open("plugins/data/itemids.txt") as f: if line.startswith("//"): continue parts = line.strip().split() - id = parts[0] + itemid = parts[0] name = " ".join(parts[1:]) - ids.append((id, name)) + ids.append((itemid, name)) @hook.command("mcid") @hook.command -def mcitem(input, reply=None): +def mcitem(inp, reply=None): """mcitem -- gets the id from an item or vice versa""" - input = input.lower().strip() + inp = inp.lower().strip() - if input == "": + if inp == "": reply("error: no input.") return results = [] - for id, name in ids: - if input == id: - results = ["\x02[{}]\x02 {}".format(id, name)] + for item_id, item_name in ids: + if inp == item_id: + results = ["\x02[{}]\x02 {}".format(item_id, item_name)] break - elif input in name.lower(): - results.append("\x02[{}]\x02 {}".format(id, name)) + elif inp in item_name.lower(): + results.append("\x02[{}]\x02 {}".format(item_id, item_name)) if not results: return "No matches found." @@ -80,12 +80,12 @@ def mcitem(input, reply=None): @hook.command("mccraft") @hook.command -def mcrecipe(input, reply=None): +def mcrecipe(inp, reply=None): """mcrecipe -- gets the crafting recipe for an item""" - input = input.lower().strip() + inp = inp.lower().strip() results = [recipe.line for recipe in recipelist - if input in recipe.output] + if inp in recipe.output] if not results: return "No matches found." diff --git a/plugins/minecraft_ping.py b/plugins/minecraft_ping.py index 0042278..d7693da 100644 --- a/plugins/minecraft_ping.py +++ b/plugins/minecraft_ping.py @@ -1,3 +1,4 @@ +# TODO: Rewrite this whole mess from util import hook import socket import struct diff --git a/plugins/mlia.py b/plugins/mlia.py index 7153081..b44211b 100644 --- a/plugins/mlia.py +++ b/plugins/mlia.py @@ -25,9 +25,9 @@ refresh_cache() def mlia(inp, reply=None): """mlia -- Gets a random quote from MyLifeIsAverage.com.""" # grab the last item in the mlia cache and remove it - id, text = mlia_cache.pop() + mlia_id, text = mlia_cache.pop() # reply with the mlia we grabbed - reply('({}) {}'.format(id, text)) + reply('({}) {}'.format(mlia_id, text)) # refresh mlia cache if its getting empty if len(mlia_cache) < 3: refresh_cache() diff --git a/plugins/password.py b/plugins/password.py index 2187302..3fc6c45 100644 --- a/plugins/password.py +++ b/plugins/password.py @@ -1,4 +1,5 @@ -# based on password generation code by TheNoodle +# TODO: Add some kind of pronounceable password generation +# TODO: Improve randomness from util import hook import string import random diff --git a/plugins/ping.py b/plugins/ping.py index 746ea05..14b8787 100644 --- a/plugins/ping.py +++ b/plugins/ping.py @@ -13,6 +13,7 @@ def ping(inp, reply=None): if os.name == "nt": return "Sorry, this command is not supported on Windows systems." + # TODO: Rewrite this entire command to work on Windows, somehow args = inp.split(' ') host = args[0] diff --git a/plugins/potato.py b/plugins/potato.py index 4eb2e98..05eb00b 100644 --- a/plugins/potato.py +++ b/plugins/potato.py @@ -51,4 +51,4 @@ def potato(inp, action=None, input=None): side_dish = random.choice(['side salad', 'dollop of sour cream', 'piece of chicken', 'bowl of shredded bacon']) action("{} a {} {} {} potato for {} and serves it with a small {}!".format(method, flavor, size, potato_type, inp, - side_dish)) + side_dish)) diff --git a/plugins/qrcode.py b/plugins/qrcode.py index f14437f..9d481e0 100644 --- a/plugins/qrcode.py +++ b/plugins/qrcode.py @@ -8,9 +8,9 @@ def qrcode(inp): """qrcode [link] returns a link for a QR code.""" args = { - "cht": "qr", # chart type + "cht": "qr", # chart type (QR) "chs": "200x200", # dimensions - "chl": inp + "chl": inp # data } link = http.prepare_url("http://chart.googleapis.com/chart", args)