changeset 2441:3b2fe433b06a

Comment parser: add 'value' cell, UTF encoding by default
author Brecht De Man <b.deman@qmul.ac.uk>
date Mon, 13 Jun 2016 16:39:40 +0200
parents 701636813780
children 23e6eb6d416c 7bafbd5441ea
files python/comment_parser.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/comment_parser.py	Sun Jun 05 16:26:58 2016 +0200
+++ b/python/comment_parser.py	Mon Jun 13 16:39:40 2016 +0200
@@ -74,14 +74,17 @@
                                             dialect="excel",
                                             quoting=csv.QUOTE_ALL)
                         commentstr = audioelement.find("./comment/response").text
+                        valuestr = audioelement.find("./value").text
 
                         if commentstr is None:
                            commentstr = ''
+                        if valuestr is None:
+                           valuestr = ''
 
                         # anonymous comments:
                         #writer.writerow([commentstr])  # .encode("utf-8")
                         # comments with (file) name:
-                        writer.writerow([file[:-4]] + [commentstr]) 
+                        writer.writerow([file[:-4]] + [valuestr] + [commentstr.encode("utf-8")]) 
 
                     #TODO Replace 'new line' in comment with something else?