changeset 6:12bc09b4a26d draft

Adding TrinityPath/util to the PATH so other utilities can be found.
author trinity_ctat
date Tue, 26 Sep 2017 13:58:08 -0400
parents 98d99fed9d35
children 78d12a725443
files trinityToolWrapper.py
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/trinityToolWrapper.py	Tue Sep 26 13:33:20 2017 -0400
+++ b/trinityToolWrapper.py	Tue Sep 26 13:58:08 2017 -0400
@@ -44,6 +44,8 @@
             print "The new path is: {:s}".format(TrinityPath)
         # Take off the last part of the path (which is the Trinity command)
         TRINITY_BASE_DIR = "/".join(TrinityPath.split("/")[0:-1])
+else:
+    print "Either set TRINITY_HOME to the trinity base directory, or ensure that directory is in the PATH."
 
 # get bindir
 bindir = sys.argv[0]
@@ -56,10 +58,15 @@
 
 
 ## add locations of tools to path setting.
-TOOL_PATHS_FILE = bindir + "/__add_to_PATH_setting.txt";
-for line in open(TOOL_PATHS_FILE):
-    line = line.rstrip()
-    os.environ['PATH'] += ":" + line
+#TOOL_PATHS_FILE = bindir + "/__add_to_PATH_setting.txt";
+#for line in open(TOOL_PATHS_FILE):
+#    line = line.rstrip()
+#    os.environ['PATH'] += ":" + line
+
+# Add TrinityPath and its utils to the PATH environment variable.
+# print "Initially the PATH env variable is:\n\t{:s}".format(os.environ['PATH'])
+os.environ['PATH'] = os.environ['PATH'] + ":{:s}:{:s}".format(TRINITY_BASE_DIR,TRINITY_BASE_DIR+"/util")
+# print "Now the PATH env variable is:\n\t{:s}".format(os.environ['PATH'])
 
 
 def stop_err( msg ):
@@ -79,6 +86,7 @@
     #args.append( ">" )
     #args.append( "/dev/null" )
     print "The TRINITY_BASE_DIR is:\n\t{:s}".format(TRINITY_BASE_DIR)
+    print "The PATH env variable is:\n\t{:s}".format(os.environ['PATH'])
 
     args[0] = "".join([TRINITY_BASE_DIR, '/', args[0]]);