Files
urlbot-native/local_config.py.skel

51 lines
1019 B
Plaintext
Raw Normal View History

#!/usr/bin/python3
2014-09-14 12:26:39 +02:00
import time, sys
def _logger(a, b): sys.stderr.write('logger: %s::%s\n' %(a, b))
try: logger
except NameError: logger = _logger
2014-09-27 05:59:35 +02:00
2014-09-14 12:26:39 +02:00
if '__main__' == __name__:
print('''this is a config file, which is not meant to be executed''')
2014-09-14 12:26:39 +02:00
exit(-1)
config = {
'src-url': 'FIXME',
'bot_user': 'urlbot',
'bot_owner': 'FIXME',
'hist_max_count': 5,
'hist_max_time': 10 * 60,
'uptime': -time.time(),
'request_counter': 0,
'path_event_files': 'event_files',
'path_cmdfifo': 'cmdfifo',
'persistent_storage': 'urlbot.persistent',
'url_blacklist': [
r'^.*heise\.de/[^/]+/meldung/.*$',
r'^.*wikipedia\.org/wiki/.*$'
],
# the "dice" feature will use more efficient random data (0) for given users
'enhanced-random-user': ( 'FIXME', 'FIXME' ),
'tea_steep_time': (3*60 + 40),
2014-09-29 19:15:00 +02:00
'image_preview': True
}
2014-10-03 19:18:52 +02:00
2014-09-14 12:26:39 +02:00
def conf(val):
if val in list(config.keys()):
2014-09-14 12:26:39 +02:00
return config[val]
logger('warn', 'conf(): unknown key ' + str(val))
2014-09-14 12:26:39 +02:00
return None
def set_conf(key, val):
config[key] = val
return None