Skip to content

Commit bc1c6f3

Browse files
author
Jon Palmer
committed
support TRINITY_HOME or TRINITYHOME
1 parent ad15664 commit bc1c6f3

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

funannotate/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (1, 7, 0)
1+
VERSION = (1, 7, 1)
22

33
__version__ = '.'.join(map(str, VERSION))

funannotate/check.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def check_version2(name):
116116
vers = subprocess.Popen(
117117
[name, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[1]
118118
vers = vers.strip()
119-
vers = vers.split(': ')[-1]
119+
vers = vers.split(': ')[-1]
120120
elif name == 'emapper.py':
121121
vers = subprocess.Popen([name, '--version'], stdout=subprocess.PIPE).communicate()[
122122
0].split('\n')[1].replace('emapper-', '')
@@ -365,7 +365,15 @@ def main(args):
365365
if show:
366366
print('$%s=%s' % (var, VARI))
367367
except KeyError:
368-
missing.append(var)
368+
if var == 'TRINITYHOME':
369+
try:
370+
VARI = os.environ['TRINITY_HOME']
371+
if show:
372+
print('$%s=%s' % ('TRINITY_HOME', VARI))
373+
except KeyError:
374+
missing.addend(var)
375+
else:
376+
missing.append(var)
369377
pass
370378
if len(missing) > 0:
371379
for x in missing:

funannotate/train.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,12 @@ def __init__(self, prog):
689689
try:
690690
TRINITY = os.environ["TRINITYHOME"].strip()
691691
except KeyError:
692-
lib.log.error(
693-
"$TRINITYHOME environmental variable not found, TRINITY is not properly configured. You can use the --TRINITYHOME argument to specify a path at runtime.")
694-
sys.exit(1)
692+
try:
693+
TRINITY = os.environ["TRINITY_HOME"].strip()
694+
except KeyError:
695+
lib.log.error(
696+
"$TRINITYHOME nor $TRINITY_HOME environmental variable not found, TRINITY is not properly configured. You can use the --TRINITYHOME argument to specify a path at runtime.")
697+
sys.exit(1)
695698
else:
696699
TRINITY = args.TRINITYHOME.strip()
697700

funannotate/update.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,12 @@ def __init__(self, prog):
16381638
try:
16391639
TRINITY = os.environ["TRINITYHOME"].strip()
16401640
except KeyError:
1641-
lib.log.error(
1642-
"$TRINITYHOME environmental variable not found, TRINITY is not properly configured. You can use the --TRINITYHOME argument to specify a path at runtime.")
1643-
sys.exit(1)
1641+
try:
1642+
TRINITY = os.environ["TRINITY_HOME"].strip()
1643+
except KeyError:
1644+
lib.log.error(
1645+
"$TRINITYHOME nor $TRINITY_HOME environmental variable not found, TRINITY is not properly configured. You can use the --TRINITYHOME argument to specify a path at runtime.")
1646+
sys.exit(1)
16441647
else:
16451648
TRINITY = args.TRINITYHOME.strip()
16461649

0 commit comments

Comments
 (0)