# HG changeset patch # User trinity_ctat # Date 1506448688 14400 # Node ID 12bc09b4a26d8cc30eb1320f500ec12c9615f2ca # Parent 98d99fed9d358eb2572be7c6c030453578eef489 Adding TrinityPath/util to the PATH so other utilities can be found. diff -r 98d99fed9d35 -r 12bc09b4a26d trinityToolWrapper.py --- 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]]);