[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - HTTPRequest.py:1.61.6.7
Martijn Pieters
mj@zope.com
Mon, 22 Jul 2002 16:31:59 -0400
Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv4736
Modified Files:
Tag: Zope-2_5-branch
HTTPRequest.py
Log Message:
Merge simplication from trunk
=== Zope/lib/python/ZPublisher/HTTPRequest.py 1.61.6.6 => 1.61.6.7 ===
if mapping_object.has_key(key):
if flags&RECORDS:
#Get the list and the last record
- #in the list
+ #in the list. reclist is mutable.
reclist = mapping_object[key]
x = reclist[-1]
if not hasattr(x,attr):
#If the attribute does not
#exist, setit
if flags&SEQUENCE: item=[item]
- reclist.remove(x)
setattr(x,attr,item)
- reclist.append(x)
- mapping_object[key] = reclist
else:
if flags&SEQUENCE:
# If the attribute is a
# sequence, append the item
# to the existing attribute
- reclist.remove(x)
y = getattr(x, attr)
y.append(item)
setattr(x, attr, y)
- reclist.append(x)
- mapping_object[key] = reclist
else:
# Create a new record and add
# it to the list
n=record()
setattr(n,attr,item)
- reclist.append(n)
- mapping_object[key]=reclist
elif flags&RECORD:
b=mapping_object[key]
if flags&SEQUENCE: