scope fixes; put uptime to conf()
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
if '__main__' == __name__:
|
if '__main__' == __name__:
|
||||||
print '''this is a config file, which is not meant to be executed'''
|
print '''this is a config file, which is not meant to be executed'''
|
||||||
exit(-1)
|
exit(-1)
|
||||||
@@ -13,6 +15,8 @@ config['bot_owner'] = 'FIXME'
|
|||||||
config['hist_max_count'] = 5
|
config['hist_max_count'] = 5
|
||||||
config['hist_max_time'] = 10 * 60
|
config['hist_max_time'] = 10 * 60
|
||||||
|
|
||||||
|
config['uptime'] = -time.time()
|
||||||
|
|
||||||
# the "dice" feature will use more efficient random data (0) for given users
|
# the "dice" feature will use more efficient random data (0) for given users
|
||||||
config['enhanced-random-user'] = ( 'FIXME', 'FIXME' )
|
config['enhanced-random-user'] = ( 'FIXME', 'FIXME' )
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ def command_uptime(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if 'uptime' in args['data']:
|
if 'uptime' in args['data']:
|
||||||
u = int(uptime + time.time())
|
u = int(conf('uptime') + time.time())
|
||||||
plural_uptime = 's'
|
plural_uptime = 's'
|
||||||
plural_request = 's'
|
plural_request = 's'
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ fifo_path = os.path.join(basedir, 'cmdfifo')
|
|||||||
# rate limiting to 5 messages per 10 minutes
|
# rate limiting to 5 messages per 10 minutes
|
||||||
hist_ts = []
|
hist_ts = []
|
||||||
hist_flag = True
|
hist_flag = True
|
||||||
uptime = -time.time()
|
|
||||||
request_counter = 0
|
request_counter = 0
|
||||||
|
|
||||||
parser = None
|
parser = None
|
||||||
@@ -240,6 +239,7 @@ plugins.logger = logger
|
|||||||
plugins.ratelimit_exceeded = ratelimit_exceeded
|
plugins.ratelimit_exceeded = ratelimit_exceeded
|
||||||
plugins.ratelimit_touch = ratelimit_touch
|
plugins.ratelimit_touch = ratelimit_touch
|
||||||
plugins.random = random
|
plugins.random = random
|
||||||
|
plugins.time = time
|
||||||
|
|
||||||
plugins.register_all()
|
plugins.register_all()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user