diff python/score_parser.py @ 2947:c823f62714a2

Update score_parser.py Add condition to exclude parsing scores of outside references.
author iiphii <epdamskagg@gmail.com>
date Fri, 06 Oct 2017 03:20:23 +0300
parents 151ae5a4b979
children d5c20bd0eb62 aa86f045d338
line wrap: on
line diff
--- a/python/score_parser.py	Wed Oct 04 08:58:38 2017 +0200
+++ b/python/score_parser.py	Fri Oct 06 03:20:23 2017 +0300
@@ -76,7 +76,8 @@
             # get alphabetical array of fragment IDs from this subject's XML
             fragmentnamelist = []    # make empty list
             for audioelement in page.findall("./audioelement"): # iterate over all audioelements
-                fragmentnamelist.append(audioelement.get('ref')) # add to list
+                if audioelement is not None and audioelement.get('type') != "outside-reference":
+                    fragmentnamelist.append(audioelement.get('ref')) # add to list
             
             fragmentnamelist = sorted(fragmentnamelist);    # Sort the list
             storage[page_name]['header'] = fragmentnamelist;
@@ -115,4 +116,4 @@
             for value in storage[page_name]['axis'][axis_name][subject_id]:
                 entry.append(value)
             filewriter.writerow(entry)
-        writefile.close()
\ No newline at end of file
+        writefile.close()