From f411e1be4dac16036edfd1e48da3ae768fdc9779 Mon Sep 17 00:00:00 2001 From: urlbot Date: Sat, 27 Sep 2014 06:12:34 +0200 Subject: [PATCH] scope fixes; moved VERSION to conf() --- local_config.py.skel | 2 ++ plugins.py | 2 +- urlbot.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/local_config.py.skel b/local_config.py.skel index 2451593..670b7e1 100644 --- a/local_config.py.skel +++ b/local_config.py.skel @@ -18,6 +18,8 @@ config['hist_max_time'] = 10 * 60 config['uptime'] = -time.time() config['request_counter'] = 0 +config['version'] = None + # 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 4196e02..7ea860f 100644 --- a/plugins.py +++ b/plugins.py @@ -110,7 +110,7 @@ def command_version(args): if 'version' in args['data']: return { - 'msg': args['reply_user'] + (''': I'm running ''' + VERSION) + 'msg': args['reply_user'] + (''': I'm running ''' + conf('version')) } def command_unicode(args): diff --git a/urlbot.py b/urlbot.py index 61fbd70..d63e373 100755 --- a/urlbot.py +++ b/urlbot.py @@ -244,8 +244,8 @@ plugins.time = time plugins.register_all() if '__main__' == __name__: - VERSION = get_version_git() - print sys.argv[0] + ' ' + VERSION + set_conf('version', get_version_git()) + print sys.argv[0] + ' ' + conf('version') if not os.path.exists(fifo_path): logger('error', 'fifo_path "%s" does not exist, exiting' % fifo_path)