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
e4c17d80
Commit
e4c17d80
authored
Mar 15, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge change from Zope-2_5-branch
parent
4421a558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
lib/python/ZPublisher/HTTPResponse.py
lib/python/ZPublisher/HTTPResponse.py
+17
-6
No files found.
lib/python/ZPublisher/HTTPResponse.py
View file @
e4c17d80
...
...
@@ -12,10 +12,10 @@
##############################################################################
'''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.5
3 2002/01/02 15:56:04 andreasjung
Exp $'''
__version__
=
'$Revision: 1.5
3
$'
[
11
:
-
2
]
$Id: HTTPResponse.py,v 1.5
4 2002/03/15 22:34:17 evan
Exp $'''
__version__
=
'$Revision: 1.5
4
$'
[
11
:
-
2
]
import
types
,
sys
,
re
import
types
,
os
,
sys
,
re
from
string
import
translate
,
maketrans
from
types
import
StringType
,
InstanceType
,
LongType
from
BaseResponse
import
BaseResponse
...
...
@@ -92,6 +92,17 @@ start_of_header_search=re.compile('(<head[^>]*>)', re.IGNORECASE).search
accumulate_header
=
{
'set-cookie'
:
1
}.
has_key
tb_style
=
os
.
environ
.
get
(
'HTTP_TRACEBACK_STYLE'
,
''
).
lower
()
if
tb_style
==
'none'
:
tb_delims
=
None
,
None
elif
tb_style
==
'js'
:
tb_delims
=
(
'''<pre onclick="this.firstChild.data=this.lastChild.data">
§<!--'''
,
'--></pre>'
)
elif
tb_style
==
'plain'
:
tb_delims
=
'<pre>'
,
'</pre>'
else
:
tb_delims
=
'<!--'
,
'-->'
class
HTTPResponse
(
BaseResponse
):
"""
\
An object representation of an HTTP response.
...
...
@@ -399,9 +410,9 @@ class HTTPResponse(BaseResponse):
tb
=
'
\
n
'
.
join
(
tb
)
tb
=
self
.
quoteHTML
(
tb
)
if
self
.
debug_mode
:
_tbopen
,
_tbclose
=
'<PRE>'
,
'</PRE>'
else
:
_tbopen
,
_tbclose
=
'''<pre
onclick="this.firstChild.data=this.lastChild.data">
§<!--'''
,
'--></pre>
'
else
:
_tbopen
,
_tbclose
=
tb_delims
if
_tbopen
is
None
:
return
'
'
return
"
\
n
%s
\
n
%s
\
n
%s"
%
(
_tbopen
,
tb
,
_tbclose
)
def
redirect
(
self
,
location
,
status
=
302
,
lock
=
0
):
...
...
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