PEP8, lots of tweaks/fixes

This commit is contained in:
neersighted 2012-04-02 09:17:55 -07:00
parent 641b770dc3
commit 508fec8ae8
29 changed files with 165 additions and 111 deletions

View file

@ -1,7 +1,7 @@
import re
from util import hook
@hook.command(autohelp=False)
def help(inp, input=None, bot=None, say=None, notice=None):
".help -- Gives a list of commands/help for a command."
@ -12,7 +12,9 @@ def help(inp, input=None, bot=None, say=None, notice=None):
for command, (func, args) in bot.commands.iteritems():
fn = re.match(r'^plugins.(.+).py$', func._filename)
if fn.group(1).lower() not in disabled:
if not args.get('adminonly', False) or input.mask in input.bot.config["admins"]:
if not args.get('adminonly', False) or\
input.nick in bot.config["admins"] or\
input.mask in bot.config["admins"]:
if command not in disabled_comm:
if func.__doc__ is not None:
if func in funcs:
@ -35,13 +37,13 @@ def help(inp, input=None, bot=None, say=None, notice=None):
out[1] += " " + str(x)
else:
out[0] += " " + str(x)
notice("Commands I recognise: " + out[0][1:])
if out[1]:
notice(out[1][1:])
notice("For detailed help, do '.help <example>' where <example> is the " +
"name of the command you want help for.")
notice("For detailed help, do '.help <example>' where <example> "\
"is the name of the command you want help for.")
else:
if inp in commands:
notice(commands[inp].__doc__)