@@ -480,7 +480,7 @@ def _convert_list(self, list_node, id, name, ns):
480480 self .logger .debug ("list: Parsing %s" % list_node )
481481 for element in list_node :
482482 if element .tag == ns + "value" :
483- list .append (str (element .text ))
483+ list .append (get_string (element .text ))
484484 elif element .tag == ns + "ref" :
485485 list .append (self ._convert_ref (element , "%s.list[%s]" % (name , len (list ))))
486486 elif element .tag == ns + "object" :
@@ -502,7 +502,7 @@ def _convert_tuple(self, tuple_node, id, name, ns):
502502 self .logger .debug ("tuple: Looking at %s" % element )
503503 if element .tag == ns + "value" :
504504 self .logger .debug ("tuple: Appending %s" % element .text )
505- list .append (str (element .text ))
505+ list .append (get_string (element .text ))
506506 elif element .tag == ns + "ref" :
507507 list .append (self ._convert_ref (element , "%s.tuple(%s}" % (name , len (list ))))
508508 elif element .tag == ns + "object" :
@@ -523,7 +523,7 @@ def _convert_set(self, set_node, id, name, ns):
523523 for element in set_node :
524524 self .logger .debug ("Looking at element %s" % element )
525525 if element .tag == ns + "value" :
526- s .add (str (element .text ))
526+ s .add (get_string (element .text ))
527527 elif element .tag == ns + "ref" :
528528 s .add (self ._convert_ref (element , name + ".set" ))
529529 elif element .tag == ns + "object" :
@@ -566,14 +566,9 @@ def _convert_prop_def(self, comp, p, name, ns):
566566 return self ._convert_ref (p .find (ns + "ref" ), name )
567567 elif "value" in p .attrib or p .find (ns + "value" ) is not None :
568568 if "value" in p .attrib :
569- return ValueDef (name , str (p .get ("value" )))
569+ return ValueDef (name , get_string (p .get ("value" )))
570570 else :
571- text = p .find (ns + "value" ).text
572- try :
573- text = str (text )
574- except UnicodeEncodeError , e :
575- text = unicode (text )
576- return ValueDef (name , text )
571+ return ValueDef (name , get_string (p .find (ns + "value" ).text ))
577572 elif "dict" in p .attrib or p .find (ns + "dict" ) is not None :
578573 if "dict" in p .attrib :
579574 return self ._convert_dict (p .get ("dict" ), comp .get ("id" ), name , ns )
0 commit comments