changeset 5:16c3fad9bac5

Fixed inconsistencies in the naming of the xena base dir
author melissacline
date Mon, 08 Sep 2014 13:08:04 -0700
parents 82755b0ee5a5
children 75c7d80df9c1
files startXena.py tool_dependencies.xml
diffstat 2 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/startXena.py	Thu Sep 04 15:43:07 2014 -0700
+++ b/startXena.py	Mon Sep 08 13:08:04 2014 -0700
@@ -16,19 +16,20 @@
 def run(cmd):
     #Avoid using shell=True when we call subprocess to ensure if the Python
     #script is killed, so too is the child process.
-    try:
-        child = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
-                                 stderr=subprocess.PIPE, shell=True)
-    except Exception, err:
-        stop_err("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err))
+   print cmd
+   try:
+      child = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
+                               stderr=subprocess.PIPE, shell=True)
+   except Exception, err:
+      stop_err("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err))
     #Use .communicate as can get deadlocks with .wait(),
-    stdout, stderr = child.communicate()
-    return_code = child.returncode
-    if return_code:
-        if stderr and stdout:
-            stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, err, stdout, stderr))
-        else:
-            stop_err("Return code %i from command:\n%s\n%s" % (return_code, err, stderr))
+   stdout, stderr = child.communicate()
+   return_code = child.returncode
+   if return_code:
+      if stderr and stdout:
+         stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, err, stdout, stderr))
+      else:
+         stop_err("Return code %i from command:\n%s\n%s" % (return_code, err, stderr))
 
 
 
@@ -41,11 +42,12 @@
    jarPath = os.getenv("JAVA_JAR_PATH", "~")
    xenaJarPath = os.path.join(jarPath, "xena.jar")
    xenaBaseDir = os.getenv("XENA_BASE_DIR", "~")
-   #xenaBaseDir = os.getenv("__tool_data_path__", "~") + "/shared/xena"
-   #xenaBaseDir = args.toolDataPath + "/shared/xena"
-   cmdline = "java -jar %s -r %s/files -d %s/xena/db -t %s/tmp" % (xenaJarPath, xenaBaseDir, xenaBaseDir, xenaBaseDir)
+   cmdline = "java -jar %s -r %s/files -d %s/db -t %s/tmp >& /inside/home/cline/tmp/xena.errout" % (xenaJarPath, xenaBaseDir, xenaBaseDir, xenaBaseDir)
    for ii in range(1,len(sys.argv)):
        cmdline = "%s %s" % (cmdline, sys.argv[ii])
+   #fp = open("/inside/home/cline/tmp/xena.out", "w")
+   #fp.write("cmdline %s\n" % cmdline)
+   #fp.close()
    run(cmdline)
 
 if __name__ == '__main__':
--- a/tool_dependencies.xml	Thu Sep 04 15:43:07 2014 -0700
+++ b/tool_dependencies.xml	Mon Sep 08 13:08:04 2014 -0700
@@ -7,7 +7,7 @@
           <environment_variable name="JAVA_JAR_PATH" action="set_to">$INSTALL_DIR</environment_variable>
         </action>  
 	<action type="set_environment">
-          <environment_variable name="XENA_BASE_DIR" action="set_to">$INSTALL_DIR</environment_variable>
+          <environment_variable name="XENA_BASE_DIR" action="set_to">$INSTALL_DIR/xena</environment_variable>
         </action>
 	<action type="move_file">
 	  <source>${REPOSITORY_INSTALL_DIR}/xena.jar</source>