diff --git a/local_config.py.skel b/local_config.py.skel index 4a3edff..a1f3e2d 100644 --- a/local_config.py.skel +++ b/local_config.py.skel @@ -1,5 +1,7 @@ #!/usr/bin/python +import time + if '__main__' == __name__: print '''this is a config file, which is not meant to be executed''' exit(-1) @@ -13,6 +15,8 @@ config['bot_owner'] = 'FIXME' config['hist_max_count'] = 5 config['hist_max_time'] = 10 * 60 +config['uptime'] = -time.time() + # the "dice" feature will use more efficient random data (0) for given users config['enhanced-random-user'] = ( 'FIXME', 'FIXME' ) diff --git a/plugins.py b/plugins.py index 349b364..1207d5b 100644 --- a/plugins.py +++ b/plugins.py @@ -170,7 +170,7 @@ def command_uptime(args): } if 'uptime' in args['data']: - u = int(uptime + time.time()) + u = int(conf('uptime') + time.time()) plural_uptime = 's' plural_request = 's' diff --git a/urlbot.py b/urlbot.py index 3a1c579..01fad42 100755 --- a/urlbot.py +++ b/urlbot.py @@ -16,7 +16,6 @@ fifo_path = os.path.join(basedir, 'cmdfifo') # rate limiting to 5 messages per 10 minutes hist_ts = [] hist_flag = True -uptime = -time.time() request_counter = 0 parser = None @@ -240,6 +239,7 @@ plugins.logger = logger plugins.ratelimit_exceeded = ratelimit_exceeded plugins.ratelimit_touch = ratelimit_touch plugins.random = random +plugins.time = time plugins.register_all()