Skip to content

Commit

Permalink
simplify version
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Aug 20, 2014
1 parent 7fb3985 commit 8dd4aa8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/exaproxy/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sbin/exaproxy
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

export exaproxy_release="1.2.0"

dirname=`dirname $0`

case $dirname in
Expand Down
3 changes: 0 additions & 3 deletions scripts/exaproxy
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python

import os
os.environ['exaproxy_release'] = '1.2.0'

from exaproxy.application import main
main()

0 comments on commit 8dd4aa8

Please sign in to comment.