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
f718847e
Commit
f718847e
authored
Jun 30, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed indentation problem in a bunch of new code.
parent
3d742d26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
81 deletions
+81
-81
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+81
-81
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
f718847e
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
import
regex
,
sys
,
os
,
string
from
string
import
lower
,
atoi
,
rfind
,
split
,
strip
,
join
,
upper
,
find
...
...
@@ -392,87 +392,87 @@ class HTTPRequest(BaseRequest):
if
seqf
:
item
=
[
item
]
mapping_object
[
key
]
=
item
#insert defaults into form dictionary
for
keys
,
values
in
defaults
.
items
():
if
not
form
.
has_key
(
keys
)
and
not
form
==
{}:
# if the form does not have the key and the
# form is not empty, set the default
form
[
keys
]
=
values
else
:
# the form has the key
if
not
form
==
{}:
if
hasattr
(
values
,
'__class__'
)
and
values
.
__class__
is
record
:
# if the key is mapped to a record, get the
# record
r
=
form
[
keys
]
for
k
,
v
in
values
.
__dict__
.
items
():
# loop through the attributes and values
# in the default dictionary
if
not
hasattr
(
r
,
k
):
# if the form dictionary doesn't have
# the attribute, set it to the default
setattr
(
r
,
k
,
v
)
form
[
keys
]
=
r
#insert defaults into form dictionary
for
keys
,
values
in
defaults
.
items
():
if
not
form
.
has_key
(
keys
)
and
not
form
==
{}:
# if the form does not have the key and the
# form is not empty, set the default
form
[
keys
]
=
values
else
:
# the form has the key
if
not
form
==
{}:
if
hasattr
(
values
,
'__class__'
)
and
values
.
__class__
is
record
:
# if the key is mapped to a record, get the
# record
r
=
form
[
keys
]
for
k
,
v
in
values
.
__dict__
.
items
():
# loop through the attributes and values
# in the default dictionary
if
not
hasattr
(
r
,
k
):
# if the form dictionary doesn't have
# the attribute, set it to the default
setattr
(
r
,
k
,
v
)
form
[
keys
]
=
r
else
:
# the key is mapped to a list
l
=
form
[
keys
]
for
x
in
values
:
# for each x in the list
if
hasattr
(
x
,
'__class__'
)
and
x
.
__class__
is
record
:
# if the x is a record
for
k
,
v
in
x
.
__dict__
.
items
():
# loop through each attribute and value in the
# record
for
y
in
l
:
# loop through each record in the form list
# if it doesn't have the attributes in the
# default dictionary, set them
if
not
hasattr
(
y
,
k
):
setattr
(
y
,
k
,
v
)
else
:
# x is not a record
if
not
a
in
l
:
l
.
append
(
a
)
form
[
keys
]
=
l
# Convert to tuples
for
key
in
tuple_items
.
keys
():
# Split the key and get the attr
k
=
split
(
key
,
"."
)
k
,
attr
=
join
(
k
[:
-
1
],
"."
),
k
[
-
1
]
a
=
attr
# remove any type_names in the attr
while
not
a
==
''
:
a
=
split
(
a
,
":"
)
a
,
new
=
join
(
a
[:
-
1
],
":"
),
a
[
-
1
]
attr
=
new
if
form
.
has_key
(
k
):
# If the form has the split key get its value
item
=
form
[
k
]
if
hasattr
(
item
,
'__class__'
)
and
item
.
__class__
is
record
:
# if the value is mapped to a record, check if it
# has the attribute, if it has it, convert it to
# a tuple and set it
if
hasattr
(
item
,
attr
):
value
=
tuple
(
getattr
(
item
,
attr
))
setattr
(
item
,
attr
,
value
)
else
:
# the key is mapped to a list
l
=
form
[
keys
]
for
x
in
values
:
# for each x in the list
if
hasattr
(
x
,
'__class__'
)
and
x
.
__class__
is
record
:
# if the x is a record
for
k
,
v
in
x
.
__dict__
.
items
():
# loop through each attribute and value in the
# record
for
y
in
l
:
# loop through each record in the form list
# if it doesn't have the attributes in the
# default dictionary, set them
if
not
hasattr
(
y
,
k
):
setattr
(
y
,
k
,
v
)
else
:
# x is not a record
if
not
a
in
l
:
l
.
append
(
a
)
form
[
keys
]
=
l
# Convert to tuples
for
key
in
tuple_items
.
keys
():
# Split the key and get the attr
k
=
split
(
key
,
"."
)
k
,
attr
=
join
(
k
[:
-
1
],
"."
),
k
[
-
1
]
a
=
attr
# remove any type_names in the attr
while
not
a
==
''
:
a
=
split
(
a
,
":"
)
a
,
new
=
join
(
a
[:
-
1
],
":"
),
a
[
-
1
]
attr
=
new
if
form
.
has_key
(
k
):
# If the form has the split key get its value
item
=
form
[
k
]
if
hasattr
(
item
,
'__class__'
)
and
item
.
__class__
is
record
:
# if the value is mapped to a record, check if it
# has the attribute, if it has it, convert it to
# a tuple and set it
if
hasattr
(
item
,
attr
):
value
=
tuple
(
getattr
(
item
,
attr
))
setattr
(
item
,
attr
,
value
)
else
:
# It is mapped to a list of records
for
x
in
item
:
# loop through the records
if
hasattr
(
x
,
attr
):
# If the record has the attribute
# convert it to a tuple and set it
value
=
tuple
(
getattr
(
x
,
attr
))
setattr
(
x
,
attr
,
value
)
else
:
# the form does not have the split key
if
form
.
has_key
(
key
):
# if it has the original key, get the item
# convert it to a tuple
item
=
form
[
key
]
item
=
tuple
(
form
[
key
])
form
[
key
]
=
item
# It is mapped to a list of records
for
x
in
item
:
# loop through the records
if
hasattr
(
x
,
attr
):
# If the record has the attribute
# convert it to a tuple and set it
value
=
tuple
(
getattr
(
x
,
attr
))
setattr
(
x
,
attr
,
value
)
else
:
# the form does not have the split key
if
form
.
has_key
(
key
):
# if it has the original key, get the item
# convert it to a tuple
item
=
form
[
key
]
item
=
tuple
(
form
[
key
])
form
[
key
]
=
item
other
=
self
.
other
=
{}
other
.
update
(
form
)
...
...
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