Skip to content
Snippets Groups Projects
Commit 7114ce1a authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'hash-version-fix' into 'master'

ENH: update fslversion call for the future :hash version

See merge request fsl/fslpy!127
parents 430bba8b 12e9b081
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,5 @@ Paul McCarthy <pauldmccarthy@gmail.com> ...@@ -2,4 +2,5 @@ Paul McCarthy <pauldmccarthy@gmail.com>
Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Matthew Webster <matthew.webster@ndcn.ox.ac.uk> Matthew Webster <matthew.webster@ndcn.ox.ac.uk>
Sean Fitzgibbon <sean.fitzgibbon@ndcn.ox.ac.uk> Sean Fitzgibbon <sean.fitzgibbon@ndcn.ox.ac.uk>
Martin Craig <martin.craig@eng.ox.ac.uk> Martin Craig <martin.craig@eng.ox.ac.uk>
\ No newline at end of file Taylor Hanayik <taylor.hanayik@ndcn.ox.ac.uk>
\ No newline at end of file
...@@ -287,7 +287,10 @@ class Platform(notifier.Notifier): ...@@ -287,7 +287,10 @@ class Platform(notifier.Notifier):
if op.exists(versionFile): if op.exists(versionFile):
with open(versionFile, 'rt') as f: with open(versionFile, 'rt') as f:
self.__fslVersion = f.read().strip() # split string at colon for new hash style versions
# first object in list is the non-hashed version string (e.g. 6.0.2)
# if no ":hash:" then standard FSL version string is still returned
self.__fslVersion = f.read().strip().split(":")[0]
self.notify(value=value) self.notify(value=value)
......
...@@ -161,7 +161,7 @@ def test_fsldir(): ...@@ -161,7 +161,7 @@ def test_fsldir():
def makeFSL(): def makeFSL():
os.makedirs(op.join(fsldir, 'etc')) os.makedirs(op.join(fsldir, 'etc'))
with open(op.join(fsldir, 'etc', 'fslversion'), 'wt') as f: with open(op.join(fsldir, 'etc', 'fslversion'), 'wt') as f:
f.write('Dummy FSL\n') f.write('6.0.2:7606e0d8\n')
try: try:
...@@ -182,7 +182,7 @@ def test_fsldir(): ...@@ -182,7 +182,7 @@ def test_fsldir():
assert os.environ['FSLDIR'] == fsldir assert os.environ['FSLDIR'] == fsldir
assert newFSLDir[0] == fsldir assert newFSLDir[0] == fsldir
assert p.fsldir == fsldir assert p.fsldir == fsldir
assert p.fslVersion == 'Dummy FSL' assert p.fslVersion == '6.0.2'
finally: finally:
shutil.rmtree(testdir) shutil.rmtree(testdir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment