Fix ticket:145 this patch includes the tar.bz2 extension in the scores pattern.
authorDiane Trout <diane@caltech.edu>
Mon, 14 Sep 2009 18:51:30 +0000 (18:51 +0000)
committerDiane Trout <diane@caltech.edu>
Mon, 14 Sep 2009 18:51:30 +0000 (18:51 +0000)
Also for good measure I check for tar.gz and .tgz. This'll
help avoid the problem of something else showing up in the directory
that matches the pattern scores*, like scores.tar.bz2.md5

htsworkflow/frontend/samples/results.py

index c2419cd916d110463297f97d4bf6a5b7449d78dc..39797b12d8c574f2660b3a57fb4fb3f432e746aa 100644 (file)
@@ -95,7 +95,11 @@ def get_flowcell_result_dict(flowcell_id):
             
         ###############################
         # scores.tar.gz
-        scores_filepath = glob.glob(os.path.join(c_dir_path, 'scores*'))
+        # restrict to only compressed files, so in case there are *.md5 files
+        # we don't get confused.
+        scores_filepath = []
+        for pattern in ['scores*.tar.bz2', 'scores*.tar.gz', 'scores*.tgz']:
+            scores_filepath += glob.glob(os.path.join(c_dir_path, pattern))
         
         if len(scores_filepath) == 0:
             d[c_dir]['scores'] = None