Browse Source

watcher_logic -> rules

tags/v0.1^2
Ben Kurtovic 13 years ago
parent
commit
b7b885beb4
2 changed files with 9 additions and 12 deletions
  1. +1
    -4
      bot/rules.py
  2. +8
    -8
      bot/watcher.py

bot/watcher_logic.py → bot/rules.py View File

@@ -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

+ 8
- 8
bot/watcher.py View File

@@ -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:


Loading…
Cancel
Save