From 76c3d9dd3edd181bfc87f102763b88f8b9145cde Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 19 Apr 2011 01:44:49 -0400 Subject: [PATCH] renaming triggers.py to command_handler.py --- irc/{triggers.py => command_handler.py} | 0 irc/commands/help.py | 4 ++-- irc/frontend.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) rename irc/{triggers.py => command_handler.py} (100%) diff --git a/irc/triggers.py b/irc/command_handler.py similarity index 100% rename from irc/triggers.py rename to irc/command_handler.py diff --git a/irc/commands/help.py b/irc/commands/help.py index d4c0907..a2e2aed 100644 --- a/irc/commands/help.py +++ b/irc/commands/help.py @@ -4,7 +4,7 @@ from irc.base_command import BaseCommand from irc.data import Data -from irc import triggers +from irc import command_handler class Help(BaseCommand): def get_hook(self): @@ -29,7 +29,7 @@ class Help(BaseCommand): def do_command_help(self, data): command = data.args[0] - commands = triggers.get_commands() + commands = command_handler.get_commands() dummy = Data() # dummy message to test which command classes pick up this command dummy.command = command diff --git a/irc/frontend.py b/irc/frontend.py index 6780096..283a926 100644 --- a/irc/frontend.py +++ b/irc/frontend.py @@ -6,7 +6,7 @@ import re from config.irc_config import * from config.secure_config import * -from irc import triggers +from irc import command_handler from irc.connection import Connection from irc.data import Data @@ -19,7 +19,7 @@ def get_connection(): def startup(conn): global connection connection = conn - triggers.init_commands(connection) + command_handler.init_commands(connection) connection.connect() def main(): @@ -43,7 +43,7 @@ def main(): data.nick, data.ident, data.host = re.findall(":(.*?)!(.*?)@(.*?)\Z", line[0])[0] data.chan = line[2][1:] - triggers.check("join", data) # check if there's anything we can respond to, and if so, respond + command_handler.check("join", data) # check if there's anything we can respond to, and if so, respond if line[1] == "PRIVMSG": data.nick, data.ident, data.host = re.findall(":(.*?)!(.*?)@(.*?)\Z", line[0])[0] @@ -52,11 +52,11 @@ def main(): if data.chan == NICK: # this is a privmsg to us, so set 'chan' as the nick of the sender data.chan = data.nick - triggers.check("msg_private", data) # only respond if it's a private message + command_handler.check("msg_private", data) # only respond if it's a private message else: - triggers.check("msg_public", data) # only respond if it's a public (channel) message + command_handler.check("msg_public", data) # only respond if it's a public (channel) message - triggers.check("msg", data) # check for general messages + command_handler.check("msg", data) # check for general messages if data.msg.startswith("!restart"): # hardcode the !restart command (we can't restart from within an ordinary command) if data.host in OWNERS: