# HG changeset patch
# User melissacline
# Date 1409868212 25200
# Node ID 00ea1bdc1aed55d69f74a4a10d31772b2c1f465c
# Parent 0676a227dbc6f22c039384b20b308ef91a568c0c
Updated the repo in the test toolshed - this should work now
diff -r 0676a227dbc6 -r 00ea1bdc1aed startXena.py
--- a/startXena.py Wed Sep 03 15:37:49 2014 -0400
+++ b/startXena.py Thu Sep 04 15:03:32 2014 -0700
@@ -5,15 +5,15 @@
import subprocess
import sys
-def stop_err(msg, fp, error_level=1):
+def stop_err(msg, error_level=1):
"""Print error message to stdout and quit with given error level."""
- #sys.stderr.write("%s\n" % msg)
- fp.write("%s\n" % msg)
- fp.write("error code %d\n" % error_level)
+ sys.stderr.write("%s\n" % msg)
+ #fp.write("%s\n" % msg)
+ #fp.write("error code %d\n" % error_level)
sys.exit(error_level)
-def run(cmd, fp):
+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:
@@ -26,27 +26,32 @@
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), fp)
+ 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), fp)
+ stop_err("Return code %i from command:\n%s\n%s" % (return_code, err, stderr))
def main():
- jarPath = os.getenv("JAVA_JAR_PATH", "~")
- xenaBaseDir = os.getenv("XENA_BASE_DIR", "~")
- xenaJarPath = os.path.join(jarPath, "xena.jar")
- xenaBaseDir = os.getenv("XENA_BASE_DIR", "~")
- cmdline = "java -jar %s -r %s/xena/files -d %s/xena/db -t %s/xena/tmp" % (xenaJarPath, xenaBaseDir, xenaBaseDir, xenaBaseDir)
- for ii in range(1,len(sys.argv)):
- cmdline = "%s %s" % (cmdline, sys.argv[ii])
- print "executing", cmdline
- fp = open("/inside/home/cline/tmp/xena.out", "w")
- fp.write("jar path (not paht) %s\n" % (jarPath))
- fp.write("xena base dir %s\n" % (xenaBaseDir))
- fp.write(cmdline)
- run(cmdline, fp)
- fp.close()
+ #parser = argparse.ArgumentParser()
+ #parser.add_argument("-H", "--host", type=str)
+ #parser.add_argument("-p", "--port", type=str)
+ #args = parser.parse_args()
+
+ 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)
+ for ii in range(1,len(sys.argv)):
+ cmdline = "%s %s" % (cmdline, sys.argv[ii])
+ fp = open("/Users/melissacline/tmp/xena.out", "w")
+ fp.write("jar path (not paht) %s\n" % (jarPath))
+ fp.write("xena base dir %s\n" % (xenaBaseDir))
+ fp.write(cmdline)
+ run(cmdline)
+ fp.close()
if __name__ == '__main__':
main( )
diff -r 0676a227dbc6 -r 00ea1bdc1aed tool_dependencies.xml
--- a/tool_dependencies.xml Wed Sep 03 15:37:49 2014 -0400
+++ b/tool_dependencies.xml Thu Sep 04 15:03:32 2014 -0700
@@ -3,16 +3,16 @@
+
+ $INSTALL_DIR
+
+
+ $INSTALL_DIR
+
${INSTALL_DIR}
-
- $INSTALL_DIR
-
-
- $INSTALL_DIR/xena
-
diff -r 0676a227dbc6 -r 00ea1bdc1aed xena.xml
--- a/xena.xml Wed Sep 03 15:37:49 2014 -0400
+++ b/xena.xml Thu Sep 04 15:03:32 2014 -0700
@@ -4,7 +4,7 @@
installXena
- startXena.py -H 0.0.0.0 -p 1236 &
+ startXena.py -H 0.0.0.0 -p 1236 &
Press the Execute button to start the Xena VM.