|
@@ -2,10 +2,18 @@ |
|
|
|
|
|
|
|
|
"""Generates help information.""" |
|
|
"""Generates help information.""" |
|
|
|
|
|
|
|
|
from irc import triggers |
|
|
|
|
|
|
|
|
|
|
|
connection, data = None, None |
|
|
connection, data = None, None |
|
|
|
|
|
|
|
|
|
|
|
def get_alias(key): |
|
|
|
|
|
"""connect command aliases with their file, e.g. so we know !voice corresponds to chanops.py""" |
|
|
|
|
|
aliases = { |
|
|
|
|
|
"voice": "chanops", |
|
|
|
|
|
"devoice": "chanops", |
|
|
|
|
|
"op": "chanops", |
|
|
|
|
|
"deop": "chanops", |
|
|
|
|
|
} |
|
|
|
|
|
return aliases[key] |
|
|
|
|
|
|
|
|
def call(c, d): |
|
|
def call(c, d): |
|
|
global connection, data |
|
|
global connection, data |
|
|
connection, data = c, d |
|
|
connection, data = c, d |
|
@@ -26,10 +34,11 @@ def do_command_help(): |
|
|
exec "from irc.commands import %s as this_command" % command |
|
|
exec "from irc.commands import %s as this_command" % command |
|
|
except ImportError: # if we can't find it directly, this could be an alias for another command |
|
|
except ImportError: # if we can't find it directly, this could be an alias for another command |
|
|
try: |
|
|
try: |
|
|
this_command = triggers.get_alias(command) |
|
|
|
|
|
|
|
|
cmd = get_alias(command) |
|
|
except KeyError: |
|
|
except KeyError: |
|
|
connection.reply(data.chan, data.nick, "command \x0303%s\x0301 not found!" % command) |
|
|
connection.reply(data.chan, data.nick, "command \x0303%s\x0301 not found!" % command) |
|
|
return |
|
|
return |
|
|
|
|
|
exec "from irc.commands import %s as this_command" % cmd |
|
|
|
|
|
|
|
|
info = this_command.__doc__ |
|
|
info = this_command.__doc__ |
|
|
|
|
|
|
|
|