comparison 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
comparison
equal deleted inserted replaced
1029:5a1313f44e93 1030:057c6b039f4e
16 16
17 # get list of all pages this subject evaluated 17 # get list of all pages this subject evaluated
18 for audioholder in root.findall("./audioholder"): # iterate over pages 18 for audioholder in root.findall("./audioholder"): # iterate over pages
19 page_name = audioholder.get('id') # get page name 19 page_name = audioholder.get('id') # get page name
20 #print ["DEBUG page " + page_name] 20 #print ["DEBUG page " + page_name]
21
22 if page_name is None: # ignore 'empty' audio_holders
23 break
21 24
22 file_name = 'ratings/'+page_name+'-ratings.csv' # score file name 25 file_name = 'ratings/'+page_name+'-ratings.csv' # score file name
23 26
24 # create folder 'ratings if not yet created 27 # create folder 'ratings if not yet created
25 if not os.path.exists('ratings'): 28 if not os.path.exists('ratings'):