From ffbeab7e14291a52a0a2bf53e132055681c8e090 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Fri, 23 Mar 2012 13:00:22 +1300 Subject: [PATCH] PEP-8 --- plugins/mcitems.py | 27 ++++++++++++++------------- plugins/mute.py | 3 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/mcitems.py b/plugins/mcitems.py index fb9f905..b97ce30 100644 --- a/plugins/mcitems.py +++ b/plugins/mcitems.py @@ -1,5 +1,4 @@ """ plugin by _303 (?) - pulled from by lukeroge """ from util import hook @@ -10,6 +9,7 @@ pattern = re.compile(r'^(?P\d+)x (?P.+?): (?P.*)$') recipelist = [] + class Recipe(object): __slots__ = 'output', 'count', 'ingredients', 'line' @@ -21,7 +21,8 @@ class Recipe(object): def __str__(self): return self.line - + + with open("./plugins/data/recipes.txt") as f: for line in f.readlines(): if line.startswith("//"): @@ -44,7 +45,8 @@ with open("./plugins/data/itemids.txt") as f: parts = line.strip().split() id = parts[0] name = " ".join(parts[1:]) - ids.append((id,name)) + ids.append((id, name)) + @hook.command def itemid(input, reply=None): @@ -67,21 +69,21 @@ def itemid(input, reply=None): if not len(results): reply("No matches found.") return - + if len(results) > 12: - reply("There are too many options, please narrow your search. (%s)" % len(results)) + reply("There are too many options, please narrow your search." + "(%s)" % len(results)) return - + out = ", ".join(results) - + return out - -@hook.command("crafting") +@hook.command("craft") @hook.command def recipe(input, reply=None): - ".recipe -- gets the crafting recipe for an item" + ".recipe/.craft -- gets the crafting recipe for an item" input = input.lower().strip() results = [] @@ -95,10 +97,9 @@ def recipe(input, reply=None): return if len(results) > 3: - reply("There are too many options, please narrow your search. (%s)" % len(results)) + reply("There are too many options, please narrow your search." + "(%s)" % len(results)) return for result in results: reply(result) - - diff --git a/plugins/mute.py b/plugins/mute.py index f755855..d59ded5 100755 --- a/plugins/mute.py +++ b/plugins/mute.py @@ -1,4 +1,3 @@ -# mute plugin by lukeroge and neersighted from util import hook muted = [] @@ -64,7 +63,7 @@ def mute(inp, input=None, db=None): def unmute(inp, input=None, db=None): ".unmute -- Makes the bot listen to ." target = inp - + if is_muted(target): unmute_target(target) input.notice("%s has been unmuted." % target)