Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
| File response_version.patch,
1.1 KB
(added by Felix.Schwarz, 5 years ago) |
|
updated patch: DummyRequest? is too simple, too
|
-
|
old
|
new
|
|
| 5 | 5 | import Cookie |
| 6 | 6 | |
| 7 | 7 | import cherrypy |
| | 8 | from cherrypy._cphttptools import Request |
| 8 | 9 | import sqlobject |
| 9 | 10 | from sqlobject.inheritance import InheritableSQLObject |
| 10 | 11 | |
| … |
… |
|
| 46 | 47 | def _return_directly(output, *args): |
| 47 | 48 | return output |
| 48 | 49 | |
| 49 | | class DummyRequest: |
| | 50 | class DummyRequest(Request): |
| 50 | 51 | "A very simple dummy request." |
| 51 | 52 | remote_host = "127.0.0.1" |
| 52 | 53 | |
| 53 | 54 | def __init__(self, method='GET', path='/', headers=None): |
| | 55 | super(DummyRequest, self).__init__("127.0.0.1", "4711", "127.0.0.1") |
| 54 | 56 | self.headers = headers or {} |
| 55 | 57 | self.method = method |
| 56 | 58 | self.path = path |
| | 59 | self.query_string = '' |
| 57 | 60 | self.base = '' |
| | 61 | |
| 58 | 62 | def purge__(self): |
| 59 | 63 | pass |
| 60 | 64 | |
| … |
… |
|
| 67 | 71 | orig_proc_output = controllers._process_output |
| 68 | 72 | controllers._process_output = _return_directly |
| 69 | 73 | cherrypy.serving.response = _cphttptools.Response() |
| | 74 | cherrypy.serving.response.version = "1.1" |
| 70 | 75 | cherrypy.serving.request = request |
| 71 | 76 | output = None |
| 72 | 77 | try: |
Download in other formats: