Changeset d2e018 in indico
- Timestamp:
- 04/15/11 11:12:11 (2 years ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 988cfe
- Parents:
- 48b89d
- Location:
- indico/web/wsgi
- Files:
-
- 2 edited
-
indico_wsgi_handler.py (modified) (2 diffs)
-
indico_wsgi_handler_utils.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/web/wsgi/indico_wsgi_handler.py
r66b76d rd2e018 99 99 100 100 if type(rh) == ClassType or RHHtdocs not in rh.mro(): 101 plugin_publisher(req, url, rh, m.groupdict())101 raise SERVER_RETURN, plugin_publisher(req, url, rh, m.groupdict()) 102 102 else: 103 103 # calculate the path to the resource … … 187 187 188 188 _convert_to_string(form) 189 _check_result(req, rh(req, **urlparams).process( form ))189 return _check_result(req, rh(req, **urlparams).process( form )) 190 190 191 191 def mp_legacy_publisher(req, possible_module, possible_handler): -
indico/web/wsgi/indico_wsgi_handler_utils.py
r74a94c rd2e018 601 601 to the client. 602 602 """ 603 if result or req.bytes_sent > 0: 604 605 if result is (None or 0): 606 result = "" 603 if result is (None or 0): 604 result = "" 605 else: 606 result = str(result) 607 608 # unless content_type was manually set, we will attempt 609 # to guess it 610 if not req.content_type_set_p: 611 # make an attempt to guess content-type 612 if result[:100].strip()[:6].lower() == '<html>' \ 613 or result.find('</') > 0: 614 req.content_type = 'text/html' 607 615 else: 608 result = str(result) 609 610 # unless content_type was manually set, we will attempt 611 # to guess it 612 if not req.content_type_set_p: 613 # make an attempt to guess content-type 614 if result[:100].strip()[:6].lower() == '<html>' \ 615 or result.find('</') > 0: 616 req.content_type = 'text/html' 617 else: 618 req.content_type = 'text/plain' 619 620 if req.header_only: 621 if req.status in (apache.HTTP_NOT_FOUND, ): 622 raise apache.SERVER_RETURN, req.status 623 else: 624 # It might be interesting in future not to use the write callable 625 # with all the web pages. <http://www.python.org/dev/peps/pep-0333/#the-write-callable> 626 req.write(result) 627 628 return apache.OK 629 616 req.content_type = 'text/plain' 617 618 if req.header_only: 619 if req.status in (apache.HTTP_NOT_FOUND, ): 620 raise apache.SERVER_RETURN, req.status 630 621 else: 631 req.log_error("publisher: %s returned nothing." % `object`) 632 return apache.HTTP_INTERNAL_SERVER_ERROR 622 # It might be interesting in future not to use the write callable 623 # with all the web pages. <http://www.python.org/dev/peps/pep-0333/#the-write-callable> 624 req.write(result) 625 return req.status 626 627 return apache.OK 633 628 634 629 def registerException(errorText=""):
Note: See TracChangeset
for help on using the changeset viewer.
