mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
conf() added; source command added
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.*swp
|
||||
*.pyc
|
||||
cmdfifo
|
||||
logs/
|
||||
event_files/
|
||||
|
||||
@@ -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'
|
||||
|
||||
13
local_config.py.skel
Normal file
13
local_config.py.skel
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user