diff scripts/score_parser.py @ 1030:057c6b039f4e

Comment and rating scripts: robust against audioholders without id or audioelements; fixes issue where plots were not cleared before adding new content; showing legend optional; robust against non-UTF8 characters in legend names
author Brecht De Man <BrechtDeMan@users.noreply.github.com>
date Mon, 15 Jun 2015 13:09:46 +0100
parents 4a0bfa7bef24
children ab79d76c6f85
line wrap: on
line diff
--- a/scripts/score_parser.py	Fri Jun 12 12:01:14 2015 +0100
+++ b/scripts/score_parser.py	Mon Jun 15 13:09:46 2015 +0100
@@ -18,6 +18,9 @@
         for audioholder in root.findall("./audioholder"):    # iterate over pages
             page_name = audioholder.get('id') # get page name
             #print ["DEBUG    page " + page_name]
+            
+            if page_name is None: # ignore 'empty' audio_holders
+                break
 
             file_name = 'ratings/'+page_name+'-ratings.csv' # score file name