# HG changeset patch # User www-data # Date 1492939337 -3600 # Node ID 6b02dc034a99fe379c5a47b2e2f2e31356c6f717 # Parent 3447a002fe4eba83726cb118582aea65d74fea3d# Parent 24b139760292520973381312335f481f53f3fad0 Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r 3447a002fe4e -r 6b02dc034a99 python/comment_parser.py --- a/python/comment_parser.py Fri Apr 21 17:21:02 2017 +0100 +++ b/python/comment_parser.py Sun Apr 23 10:22:17 2017 +0100 @@ -57,7 +57,7 @@ # for page [page_name], print comments related to fragment [id] for audioelement in audioholder.findall("./audioelement"): - if audioelement is not None: # Check it exists + if audioelement is not None and audioelement.get('type') != "outside-reference": audio_id = str(audioelement.get('ref')) csv_name = folder_name +'/' + page_name+'/'+page_name+'-comments-'+audio_id+'.csv' @@ -73,7 +73,10 @@ delimiter=',', dialect="excel", quoting=csv.QUOTE_ALL) - commentstr = audioelement.find("./comment/response").text + try: + commentstr = audioelement.find("./comment/response").text + except AttributeError: + commentstr = "" valuestr = audioelement.find("./value").text if commentstr is None: