Commit 193235c1 authored by Kevin Deldycke's avatar Kevin Deldycke

Take care of unicode strings


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3921 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e2afbe9
...@@ -397,7 +397,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -397,7 +397,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
for property in property_list: for property in property_list:
property_id = property[0] property_id = property[0]
value = property[1] value = property[1]
if type(value) == type(""): if type(value) in (type(''), type(u'')):
f.write(' <property id=%s type="str">%s</property>\n' % (quoteattr(property_id), escape(value))) f.write(' <property id=%s type="str">%s</property>\n' % (quoteattr(property_id), escape(value)))
elif type(value) in (type(()), type([])): elif type(value) in (type(()), type([])):
f.write(' <property id=%s type="tuple">\n' % quoteattr(property_id)) f.write(' <property id=%s type="tuple">\n' % quoteattr(property_id))
...@@ -415,7 +415,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -415,7 +415,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
if hasattr(self, 'filter_dict'): if hasattr(self, 'filter_dict'):
filter_list = [] filter_list = []
for filter_id in self.filter_dict.keys(): for filter_id in self.filter_dict.keys():
filter_definition = self.filter_dict[id] filter_definition = self.filter_dict[filter_id]
filter_list.append((filter_id, filter_definition)) filter_list.append((filter_id, filter_definition))
# Sort for easy diff # Sort for easy diff
filter_list.sort(lambda x, y: cmp(x[0], y[0])) filter_list.sort(lambda x, y: cmp(x[0], y[0]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment