diff xena_import.py @ 36:d64a002c3b0c

modify
author jingchunzhu
date Fri, 24 Jul 2015 11:39:31 -0700
parents d8dc482ef970
children 1ef1886dae04
line wrap: on
line diff
--- a/xena_import.py	Thu Jul 23 16:14:33 2015 -0700
+++ b/xena_import.py	Fri Jul 24 11:39:31 2015 -0700
@@ -118,29 +118,27 @@
                                                            xenaFileDir,
                                                            genomicDataFile, 
                                                            xena.port())
-    loadInToXena (xenaLoadCmd, fp2)
+    loadInToXena (xenaLoadCmd, genomicDataFile, fp2)
     if args.probeMap is not None:
         xenaLoadCmd = "java -jar %s -l --force %s/%s -p %s" % (xena.jarPath(),
                                                                xenaFileDir,
                                                                probeMapDataFile,
                                                                xena.port())
-        loadInToXena (xenaLoadCmd, fp2)
+        loadInToXena (xenaLoadCmd, probeMapDataFile, fp2)
+    fp2.close()
 
-
-def loadInToXena (xenaLoadCmd, fp2):
+def loadInToXena (xenaLoadCmd, name, fp2):
+    print xenaLoadCmd
     try:
         subprocess.call(xenaLoadCmd, shell=True)
     except:
         exc_type, exc_value, exc_traceback = sys.exc_info()
         lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
         allLines = ''.join('!! ' + line for line in lines)
+        fp2.write("Unsuccessful: Import %s\n" % (name))
         fp2.write("Unsuccessful: error %s\n" % allLines)
-        fp2.close()
-        sys.exit(-1)
     else:
-        fp2.write( "Import successful\n")
-        fp2.close()
-        sys.exit(0)
+        fp2.write( "Import %s is successful\n" % (name))
 
 if __name__ == "__main__":
     main()