diff metfrag.py @ 5:c53ed894d736 draft

planemo upload for repository https://github.com/computational-metabolomics/metfrag-galaxy commit 826659b9105b635cf240474428122f5a269f5c88
author tomnl
date Fri, 02 Aug 2019 11:38:06 -0400
parents eb581a101672
children 0b3816a7a14b
line wrap: on
line diff
--- a/metfrag.py	Thu Aug 01 09:02:47 2019 -0400
+++ b/metfrag.py	Fri Aug 02 11:38:06 2019 -0400
@@ -61,7 +61,8 @@
 print(args)
 
 if os.stat(args.input_pth).st_size == 0:
-    exit('Input file empty')
+    print('Input file empty')
+    exit()
 
 
 # Create temporary working directory
@@ -383,6 +384,10 @@
 # outfiles = [os.path.join(wd, f) for f in glob.glob(os.path.join(wd, "*_metfrag_result.csv"))]
 outfiles = glob.glob(os.path.join(wd, "*_metfrag_result.csv"))
 
+if len(outfiles) == 0:
+    print('No results')
+    sys.exit()
+
 headers = []
 c = 0
 for fn in outfiles:
@@ -400,6 +405,7 @@
 
 # if no data rows (e.g. matches) then do not save an output and leave the program        
 if c == 0:
+    print('No results')
     sys.exit()
 
 additional_detail_headers = ['sample_name']