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
28548bd8
Commit
28548bd8
authored
Apr 12, 2002
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Resolve Collector #89 by making repr of record eval'able as a dict.
parent
0b109961
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+4
-3
lib/python/ZPublisher/tests/testHTTPRequest.py
lib/python/ZPublisher/tests/testHTTPRequest.py
+20
-0
No files found.
doc/CHANGES.txt
View file @
28548bd8
...
...
@@ -75,6 +75,9 @@ Zope Changes
Bugs:
- Made repr of an HTTPRequest.record eval'able as a dict (Collector
#89).
- Fixed bug #144: Upload button on dtml, py scripts, images, files and
pts now raises an error if the file is not specified rather than
clearing the source.
...
...
lib/python/ZPublisher/HTTPRequest.py
View file @
28548bd8
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.6
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
7
$'
[
11
:
-
2
]
import
re
,
sys
,
os
,
urllib
,
time
,
random
,
cgi
,
codecs
from
BaseRequest
import
BaseRequest
...
...
@@ -1128,10 +1128,11 @@ class record:
return
", "
.
join
(
map
(
lambda
item
:
"%s: %s"
%
item
,
L1
))
def
__repr__
(
self
):
#return repr( self.__dict__ )
L1
=
self
.
__dict__
.
items
()
L1
.
sort
()
return
', '
.
join
(
map
(
lambda
item
:
"
%s
: %s"
%
(
item
[
0
],
repr
(
item
[
1
])),
L1
))
return
'
{%s}'
%
'
, '
.
join
(
map
(
lambda
item
:
"
'%s'
: %s"
%
(
item
[
0
],
repr
(
item
[
1
])),
L1
))
# Flags
SEQUENCE
=
1
...
...
lib/python/ZPublisher/tests/testHTTPRequest.py
0 → 100644
View file @
28548bd8
import
unittest
class
RecordTests
(
unittest
.
TestCase
):
def
test_repr
(
self
):
from
ZPublisher.HTTPRequest
import
record
record
=
record
()
record
.
a
=
1
record
.
b
=
'foo'
r
=
repr
(
record
)
d
=
eval
(
r
)
self
.
assertEqual
(
d
,
record
.
__dict__
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
RecordTests
,
'test'
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
()
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