diff --git a/.gitignore b/.gitignore index 6a07201..b452778 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .*swp +*.pyc cmdfifo logs/ event_files/ diff --git a/eventlooper.py b/eventlooper.py index d9ed54c..00c8685 100755 --- a/eventlooper.py +++ b/eventlooper.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import sys, os, re, time, urllib, pickle, random, HTMLParser +from local_config import conf BUFSIZ = 8192 delay = 0.100 # seconds @@ -211,13 +212,15 @@ def parse_commands(data): return False if 'command' in data: - chat_write(reply_user + (""": known commands: 'command', 'info', 'hangup', 'ping', 'uptime', 'version'""")) + chat_write(reply_user + (""": known commands: 'command', 'info', 'hangup', 'ping', 'uptime', 'source', 'version'""")) elif 'version' in data: chat_write(reply_user + (''': I'm running ''' + VERSION)) elif 'unikot' in data: chat_write(reply_user + (u''': ┌────────┐''')) chat_write(reply_user + (u''': │Unicode!│''')) chat_write(reply_user + (u''': └────────┘''')) + elif 'source' in data: + chat_write('My source code can be found at %s' % conf('src-url')) elif 'uptime' in data: u = int(uptime + time.time()) plural_uptime = 's' diff --git a/local_config.py.skel b/local_config.py.skel new file mode 100644 index 0000000..87d6cd6 --- /dev/null +++ b/local_config.py.skel @@ -0,0 +1,13 @@ +#!/usr/bin/python + +if '__main__' == __name__: + print '''this is a config file, which is not meant to be executed''' + exit(-1) + +config = {} +config['src-url'] = 'FIXME' + +def conf(val): + if val in config.keys(): + return config[val] + return None