|
Revision 856
(checked in by rdelon, 3 years ago)
|
Big change: camelCase to lower_with_underscore names (still need to update the book)
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
"""Base class for CherryPy filters.""" |
|---|
| 2 |
|
|---|
| 3 |
class BaseFilter(object): |
|---|
| 4 |
""" |
|---|
| 5 |
Base class for filters. Derive new filter classes from this, then |
|---|
| 6 |
override some of the methods to add some side-effects. |
|---|
| 7 |
""" |
|---|
| 8 |
|
|---|
| 9 |
def on_start_resource(self): |
|---|
| 10 |
"""Called before any request processing has been done""" |
|---|
| 11 |
pass |
|---|
| 12 |
|
|---|
| 13 |
def before_request_body(self): |
|---|
| 14 |
"""Called after the request header has been read/parsed""" |
|---|
| 15 |
pass |
|---|
| 16 |
|
|---|
| 17 |
def before_main(self): |
|---|
| 18 |
""" Called after the request body has been read/parsed""" |
|---|
| 19 |
pass |
|---|
| 20 |
|
|---|
| 21 |
def before_finalize(self): |
|---|
| 22 |
"""Called before final output processing""" |
|---|
| 23 |
pass |
|---|
| 24 |
|
|---|
| 25 |
def before_error_response(self): |
|---|
| 26 |
"""Called before _cp_on_error and/or finalizing output""" |
|---|
| 27 |
pass |
|---|
| 28 |
|
|---|
| 29 |
def after_error_response(self): |
|---|
| 30 |
"""Called after _cp_on_error and finalize""" |
|---|
| 31 |
pass |
|---|
| 32 |
|
|---|
| 33 |
def on_end_resource(self): |
|---|
| 34 |
"""Called after finalizing the output (status, header, and body)""" |
|---|
| 35 |
pass |
|---|
| 36 |
|
|---|
| 37 |
def on_end_request(self): |
|---|
| 38 |
"""Called when the server closes the request.""" |
|---|
| 39 |
pass |
|---|
| 40 |
|
|---|