From 924ecb0109bfed3d95cb7cafb28557dd7324e886 Mon Sep 17 00:00:00 2001 From: urlbot Date: Mon, 1 Dec 2014 11:55:28 +0100 Subject: [PATCH] use a more reasonable config{} definition method --- local_config.py.skel | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/local_config.py.skel b/local_config.py.skel index 7e0a78e..78a9112 100644 --- a/local_config.py.skel +++ b/local_config.py.skel @@ -10,33 +10,34 @@ 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['path_event_files'] = 'event_files' -config['path_cmdfifo'] = 'cmdfifo' -config['persistent_storage'] = 'urlbot.persistent' - -config['url_blacklist'] = [ - r'^.*heise\.de/[^/]+/meldung/.*$', - r'^.*wikipedia\.org/wiki/.*$' -] +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 -config['enhanced-random-user'] = ( 'FIXME', 'FIXME' ) + 'enhanced-random-user': ( 'FIXME', 'FIXME' ), -config['tea_steep_time'] = (3*60 + 40) + 'tea_steep_time': (3*60 + 40), -config['image_preview'] = True + 'image_preview': True +} def conf(val): if val in list(config.keys()):