Author: bugman Date: Sun Oct 11 17:14:09 2009 New Revision: 9730 URL: http://svn.gna.org/viewcvs/relax?rev=9730&view=rev Log: Created version.version_full() from the code in generic_fns.exp_info. The get_revision() and get_url() functions have had the 'get_' part removed. Modified: branches/bmrb/generic_fns/exp_info.py branches/bmrb/version.py Modified: branches/bmrb/generic_fns/exp_info.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/exp_info.py?rev=9730&r1=9729&r2=9730&view=diff ============================================================================== --- branches/bmrb/generic_fns/exp_info.py (original) +++ branches/bmrb/generic_fns/exp_info.py Sun Oct 11 17:14:09 2009 @@ -85,20 +85,7 @@ # relax. if name == 'relax': - # The relax version. - ver = version - if ver == 'repository checkout': - # Get the SVN revision and URL. - rev = get_revision() - url = get_url() - - # Change the version string. - if rev: - ver = version + " r" + rev - if url: - ver = ver + " " + url - - cdp.exp_info.software_setup(name='relax', version=ver, vendor_name='The relax development team', vendor_eaddress='http://nmr-relax.com', cite="d'Auvergne, E. J. and Gooley, P. R. (2008). Optimisation of NMR dynamic models I. Minimisation algorithms and their performance within the model-free and Brownian rotational diffusion spaces. J. Biomol. NMR, 40(2), 107-119; d'Auvergne, E. J. and Gooley, P. R. (2008). Optimisation of NMR dynamic models II. A new methodology for the dual optimisation of the model-free parameters and the Brownian rotational diffusion tensor. J. Biomol. NMR, 40(2), 121-133.", task='data processing') + cdp.exp_info.software_setup(name='relax', version=version_full(), vendor_name='The relax development team', vendor_eaddress='http://nmr-relax.com', cite="d'Auvergne, E. J. and Gooley, P. R. (2008). Optimisation of NMR dynamic models I. Minimisation algorithms and their performance within the model-free and Brownian rotational diffusion spaces. J. Biomol. NMR, 40(2), 107-119; d'Auvergne, E. J. and Gooley, P. R. (2008). Optimisation of NMR dynamic models II. A new methodology for the dual optimisation of the model-free parameters and the Brownian rotational diffusion tensor. J. Biomol. NMR, 40(2), 121-133.", task='data processing') # NMRPipe. if name == 'NMRPipe': Modified: branches/bmrb/version.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/version.py?rev=9730&r1=9729&r2=9730&view=diff ============================================================================== --- branches/bmrb/version.py (original) +++ branches/bmrb/version.py Sun Oct 11 17:14:09 2009 @@ -32,7 +32,7 @@ version = "repository checkout" -def get_revision(): +def revision(): """Attempt to retrieve the SVN revision number, if this is a checked out copy. @return: The SVN revision number, or None if unsuccessful. @@ -60,7 +60,7 @@ return row[1] -def get_url(): +def url(): """Attempt to retrieve the SVN URL, if this is a checked out copy. @return: The SVN URL, or None if unsuccessful. @@ -86,3 +86,29 @@ # The revision. if row[0] == 'URL:': return row[1] + + +def version_full(): + """Return the full relax version, including all SVN info for repository versions. + + @return: The relax version string. + @rtype: str + """ + + # The relax version. + ver = version + + # Repository version. + if ver == 'repository checkout': + # Get the SVN revision and URL. + rev = revision() + url = url() + + # Change the version string. + if rev: + ver = version + " r" + rev + if url: + ver = ver + " " + url + + # Return the version. + return ver