diff --git a/bot/watcher_logic.py b/bot/rules.py similarity index 95% rename from bot/watcher_logic.py rename to bot/rules.py index c86ac9e..f4a7a71 100644 --- a/bot/watcher_logic.py +++ b/bot/rules.py @@ -1,13 +1,10 @@ # -*- coding: utf-8 -*- """ -EarwigBot's IRC Watcher Logic +EarwigBot's IRC Watcher Rules This file contains (configurable!) rules that EarwigBot's watcher uses after it recieves an event from IRC. - -This should, ideally, be in config.json somehow, but Python code makes more -sense for this sort of thing... so... """ import re diff --git a/bot/watcher.py b/bot/watcher.py index 2e43099..c863e36 100644 --- a/bot/watcher.py +++ b/bot/watcher.py @@ -4,15 +4,15 @@ EarwigBot's IRC Watcher Component The IRC watcher runs on a wiki recent-changes server and listens for edits. -Users cannot interact with this part of the bot. When an event occurs, run it -through irc/watcher_logic.py's process() function, which can result in either -wiki bot tasks being started (listed in wiki/tasks/) or messages being sent to -channels in the IRC frontend. +Users cannot interact with this part of the bot. When an event occurs, we run +it through rules.py's process() function, which can result in wiki bot tasks +being started (located in tasks/) or messages being sent to channels on the IRC +frontend. """ import config from classes import Connection, RC, BrokenSocketException -import watcher_logic as logic +import rules frontend_conn = None @@ -81,10 +81,10 @@ def process_rc(rc): """Process a recent change event from IRC (or, an RC object). The actual processing is configurable, so we don't have that hard-coded - here. We simply call watcher_logic's process() function and expect a list - of channels back, which we report the event data to. + here. We simply call rules's process() function and expect a list of + channels back, which we report the event data to. """ - chans = watcher_logic.process(rc) + chans = rules.process(rc) if chans and frontend_conn: pretty = rc.get_pretty() for chan in chans: