[Zope-Checkins] CVS: Zope/lib/python/OFS - PropertySheets.py:1.74.4.6
Brian Lloyd
brian@digicool.com
Tue, 25 Sep 2001 09:54:39 -0400
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv2303
Modified Files:
Tag: Zope-2_4-branch
PropertySheets.py
Log Message:
Fixed PROPFIND xml generation for 'tokens' properties and fixed xml
escaping logic.
=== Zope/lib/python/OFS/PropertySheets.py 1.74.4.5 => 1.74.4.6 ===
value=self.getProperty(name)
if type=='tokens':
- value=join(value, ' ')
+ value=join(str(value), ' ')
elif type=='lines':
- value=join(value, '\n')
+ value=join(str(value), '\n')
# check for xml property
attrs=item.get('meta', {}).get('__xml_attrs__', None)
if attrs is not None:
@@ -414,9 +414,9 @@
name, type=item['id'], item.get('type','string')
value=self.getProperty(name)
if type=='tokens':
- value=join(value, ' ')
+ value=join(str(value), ' ')
elif type=='lines':
- value=join(value, '\n')
+ value=join(str(value), '\n')
# allow for xml properties
attrs=item.get('meta', {}).get('__xml_attrs__', None)
if attrs is not None:
@@ -815,9 +815,7 @@
to entities to keep the properties XML compliant.
"""
v = str(v)
-
- if v.count('<') != v.count('>'):
- v = v.replace('<','<')
- v = v.replace('>','>')
-
+ v = v.replace('&', '&')
+ v = v.replace('<', '<')
+ v = v.replace('>', '>')
return unicode(v,"latin-1").encode("utf-8")