mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
39 lines
853 B
Python
39 lines
853 B
Python
#!/usr/bin/python
|
|
|
|
import time, sys
|
|
|
|
def _logger(a, b): sys.stderr.write('logger: %s::%s\n' %(a, b))
|
|
try: logger
|
|
except NameError: logger = _logger
|
|
|
|
if '__main__' == __name__:
|
|
print '''this is a config file, which is not meant to be executed'''
|
|
exit(-1)
|
|
|
|
config = {}
|
|
config['src-url'] = 'FIXME'
|
|
|
|
config['bot_user'] = 'urlbot'
|
|
config['bot_owner'] = 'FIXME'
|
|
|
|
config['hist_max_count'] = 5
|
|
config['hist_max_time'] = 10 * 60
|
|
|
|
config['uptime'] = -time.time()
|
|
config['request_counter'] = 0
|
|
|
|
config['persistent_storage'] = 'urlbot.persistent'
|
|
|
|
# the "dice" feature will use more efficient random data (0) for given users
|
|
config['enhanced-random-user'] = ( 'FIXME', 'FIXME' )
|
|
|
|
def conf(val):
|
|
if val in config.keys():
|
|
return config[val]
|
|
logger('warn', 'conf(): unknown key ' + str(val))
|
|
return None
|
|
|
|
def set_conf(key, val):
|
|
config[key] = val
|
|
return None
|