Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a0d961df
Commit
a0d961df
authored
Jul 22, 2002
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code by relying on mutablility of the data structures.
parent
c8beeeab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+2
-10
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
a0d961df
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.7
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.7
3
$'
[
11
:
-
2
]
import
re
,
sys
,
os
,
urllib
,
time
,
random
,
cgi
,
codecs
from
BaseRequest
import
BaseRequest
...
...
@@ -491,35 +491,27 @@ class HTTPRequest(BaseRequest):
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment