瀏覽代碼

watcher_logic -> rules

tags/v0.1^2
Ben Kurtovic 13 年之前
父節點
當前提交
b7b885beb4
共有 2 個文件被更改,包括 9 次插入12 次删除
  1. +1
    -4
      bot/rules.py
  2. +8
    -8
      bot/watcher.py

bot/watcher_logic.py → 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

+ 8
- 8
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:


Loading…
取消
儲存