From 8dd4aa834ff3528914473ee8c31197fa09091a2a Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 20 Aug 2014 20:10:14 +0100 Subject: [PATCH] simplify version --- lib/exaproxy/application.py | 8 ++++---- sbin/exaproxy | 2 -- scripts/exaproxy | 3 --- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/exaproxy/application.py b/lib/exaproxy/application.py index e18ec6c..ce40922 100644 --- a/lib/exaproxy/application.py +++ b/lib/exaproxy/application.py @@ -11,6 +11,8 @@ from exaproxy.configuration import default,value,string +version = '1.2.0' + def version_warning (): sys.stdout.write('\n') sys.stdout.write('************ WARNING *** WARNING *** WARNING *** WARNING *********\n') @@ -70,7 +72,7 @@ def help (): sys.stdout.write(' - %s\n' % line) sys.stdout.write('\n') -def version (version): +def show_version (version): print 'exaproxy %s' % version def __exit(memory,code): @@ -112,8 +114,6 @@ def main (): if arg in ['-c','--conf-file']: next = 'configuration' - version = os.environ.get('exaproxy_release','unknown') - defaults = { 'tcp4' : { 'host' : (value.unquote,string.quote,'127.0.0.1', 'the host the proxy listen on'), @@ -258,7 +258,7 @@ def main (): env(True) sys.exit(0) if arg in ['-v','--version']: - version(configuration.proxy.version) + show_version(version) sys.exit(0) if arg in ['-d','--debug']: configuration.debug.log = True diff --git a/sbin/exaproxy b/sbin/exaproxy index 23878cc..5fc59a7 100755 --- a/sbin/exaproxy +++ b/sbin/exaproxy @@ -1,7 +1,5 @@ #!/bin/sh -export exaproxy_release="1.2.0" - dirname=`dirname $0` case $dirname in diff --git a/scripts/exaproxy b/scripts/exaproxy index 8fd5283..73eb210 100644 --- a/scripts/exaproxy +++ b/scripts/exaproxy @@ -1,7 +1,4 @@ #!/usr/bin/env python -import os -os.environ['exaproxy_release'] = '1.2.0' - from exaproxy.application import main main()