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
74a3d213
Commit
74a3d213
authored
Mar 18, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a few more stubs to make the (not yet really hardened)
abstract response API a litte more complete.
parent
eaf5dcbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
lib/python/ZPublisher/BaseResponse.py
lib/python/ZPublisher/BaseResponse.py
+35
-2
No files found.
lib/python/ZPublisher/BaseResponse.py
View file @
74a3d213
...
...
@@ -84,8 +84,8 @@
##############################################################################
'''CGI Response Output formatter
$Id: BaseResponse.py,v 1.
2 1999/03/10 00:15:51 kl
m Exp $'''
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
$Id: BaseResponse.py,v 1.
3 1999/03/18 22:34:53 ji
m Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
string
,
types
,
sys
,
regex
from
string
import
find
,
rfind
,
lower
,
upper
,
strip
,
split
,
join
,
translate
...
...
@@ -187,3 +187,36 @@ class BaseResponse:
"""
self
.
body
=
self
.
body
+
data
def
exception
(
self
,
fatal
=
0
,
info
=
None
):
"""Handle an exception.
The fatal argument indicates whether the error is fatal.
The info argument, if given should be a tuple with an
error type, value, and traceback.
"""
def
notFoundError
(
self
,
v
=
''
):
"""Generate an error indicating that an object was not found.
"""
raise
'Not Found'
,
v
def
debugError
(
self
,
v
=
''
):
"""Raise an error with debigging info and in debugging mode"""
raise
'Debug Error'
,
v
def
badRequestError
(
self
,
v
=
''
):
"""Raise an error indicating something wrong with the request"""
raise
'Bad Request'
,
v
def
forbiddenError
(
self
,
v
=
''
):
"""Raise an error indicating that the request cannot be done"""
raise
'Forbidden'
,
v
def
unauthorized
(
self
):
"""Raise an eror indicating that the user was not authizated
Make sure to generate an appropriate challenge, as appropriate.
"""
raise
'Unauthorized'
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