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
91b5cb3f
Commit
91b5cb3f
authored
Jun 22, 2002
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Whitespace normalization.
parent
7c228e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
lib/python/ZPublisher/BaseResponse.py
lib/python/ZPublisher/BaseResponse.py
+21
-17
No files found.
lib/python/ZPublisher/BaseResponse.py
View file @
91b5cb3f
...
...
@@ -12,8 +12,8 @@
##############################################################################
'''CGI Response Output formatter
$Id: BaseResponse.py,v 1.1
2 2002/01/02 15:56:04 andreasjung
Exp $'''
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
$Id: BaseResponse.py,v 1.1
3 2002/06/22 14:02:41 tseaver
Exp $'''
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
import
types
,
sys
from
types
import
StringType
,
InstanceType
...
...
@@ -33,17 +33,19 @@ class BaseResponse:
def
__init__
(
self
,
stdout
,
stderr
,
body
=
''
,
headers
=
None
,
status
=
None
,
cookies
=
None
):
self
.
stdout
=
stdout
self
.
stderr
=
stderr
self
.
body
=
body
if
headers
is
None
:
headers
=
{}
self
.
headers
=
headers
self
.
status
=
status
if
cookies
is
None
:
cookies
=
{}
self
.
cookies
=
cookies
self
.
stdout
=
stdout
self
.
stderr
=
stderr
self
.
body
=
body
if
headers
is
None
:
headers
=
{}
self
.
headers
=
headers
self
.
status
=
status
if
cookies
is
None
:
cookies
=
{}
self
.
cookies
=
cookies
def
setStatus
(
self
,
status
,
reason
=
None
):
self
.
status
=
status
self
.
status
=
status
def
setHeader
(
self
,
name
,
value
):
self
.
headers
[
name
]
=
value
...
...
@@ -55,7 +57,7 @@ class BaseResponse:
self
.
stdout
.
write
(
str
(
self
))
def
setBody
(
self
,
body
):
self
.
body
=
body
self
.
body
=
body
def
getStatus
(
self
):
'Returns the current HTTP status code as an integer. '
...
...
@@ -70,10 +72,11 @@ class BaseResponse:
"value". This overwrites any previously set value for the
cookie in the Response object.
'''
cookies
=
self
.
cookies
cookies
=
self
.
cookies
if
cookies
.
has_key
(
name
):
cookie
=
cookies
[
name
]
else
:
cookie
=
cookies
[
name
]
=
{}
cookie
=
cookies
[
name
]
else
:
cookie
=
cookies
[
name
]
=
{}
for
k
,
v
in
kw
.
items
():
cookie
[
k
]
=
v
cookie
[
'value'
]
=
value
...
...
@@ -104,7 +107,8 @@ class BaseResponse:
def
__repr__
(
self
):
return
'%s(%s)'
%
(
self
.
__class__
.
__name__
,
`self.body`
)
def
flush
(
self
):
pass
def
flush
(
self
):
pass
def
write
(
self
,
data
):
"""
\
...
...
@@ -121,7 +125,7 @@ class BaseResponse:
after beginning stream-oriented output.
"""
self
.
body
=
self
.
body
+
data
self
.
body
=
self
.
body
+
data
def
exception
(
self
,
fatal
=
0
,
info
=
None
):
"""Handle an exception.
...
...
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