Author: bugman Date: Tue Jun 5 18:23:21 2012 New Revision: 16676 URL: http://svn.gna.org/viewcvs/relax?rev=16676&view=rev Log: Bug fix - the 'relax --version' print out now works from any directory. This was only working if relax was being run from the installation directory! Modified: branches/uf_redesign/version.py Modified: branches/uf_redesign/version.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/version.py?rev=16676&r1=16675&r2=16676&view=diff ============================================================================== --- branches/uf_redesign/version.py (original) +++ branches/uf_redesign/version.py Tue Jun 5 18:23:21 2012 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2009 Edward d'Auvergne # +# Copyright (C) 2009-2012 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -24,9 +24,12 @@ """Module for relax version information.""" # Python module imports. -from os import F_OK, access +from os import F_OK, access, sep from string import split from subprocess import PIPE, Popen + +# relax module imports. +from status import Status; status = Status() version = "repository checkout" @@ -40,11 +43,11 @@ """ # Does the base directory exist (i.e. is this a checked out copy). - if not access('.svn', F_OK): + if not access(status.install_path+sep+'.svn', F_OK): return # Try to run 'svn info'. - pipe = Popen('svn info', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False) + pipe = Popen('svn info %s' % status.install_path, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False) # Errors. if pipe.stderr.readlines(): @@ -68,11 +71,11 @@ """ # Does the base directory exist (i.e. is this a checked out copy). - if not access('.svn', F_OK): + if not access(status.install_path+sep+'.svn', F_OK): return # Try to run 'svn info'. - pipe = Popen('svn info', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False) + pipe = Popen('svn info %s' % status.install_path, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=False) # Errors. if pipe.stderr.readlines():