Lines Matching defs:cherrypy

29 import cherrypy
30 from cherrypy._cptools import HandlerTool
31 from cherrypy.lib.static import serve_file
33 from cherrypy.process.plugins import SimplePlugin
34 from cherrypy._cperror import _HTTPErrorTemplate
98 """The DepotHTTP object is intended to be used as a cherrypy
149 cherrypy.request.path_info that returns the publisher used
259 cherrypy.config.update({'error_page.default':
262 if hasattr(cherrypy.engine, "signal_handler"):
264 cherrypy.engine.subscribe("graceful", self.refresh)
267 self.__bgtask = BackgroundTaskPlugin(cherrypy.engine)
279 cherrypy.log("Skipping indexing; another operation is "
289 response = cherrypy.response
307 return self.request_pub_func(cherrypy.request.path_info)
309 req_pub = cherrypy.request.path_info.strip("/").split(
360 now = cherrypy.response.time
370 headers = cherrypy.response.headers
409 @cherrypy.expose
423 raise cherrypy.HTTPError(http_client.NOT_FOUND,
426 request = cherrypy.request
427 response = cherrypy.response
440 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
443 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
448 raise cherrypy.HTTPError(http_client.NOT_FOUND,
453 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
459 # Finally, perform an internal redirect so that cherrypy
462 rel_uri = cherrypy.request.path_info
463 if cherrypy.request.query_string:
465 cherrypy.request.query_string)
466 raise cherrypy.InternalRedirect(rel_uri)
468 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
473 raise cherrypy.HTTPError(http_client.NOT_FOUND, "Version '{0}' not "
476 @cherrypy.tools.response_headers(headers=\
505 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
509 raise cherrypy.HTTPError(http_client.BAD_REQUEST)
515 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
517 raise cherrypy.HTTPError(http_client.SERVICE_UNAVAILABLE,
523 cherrypy.log("Request failed: {0}".format(str(e)))
524 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
538 cherrypy.response.status = http_client.NO_CONTENT
541 response = cherrypy.response
578 raise cherrypy.HTTPError(http_client.FORBIDDEN,
588 cherrypy.log("Request failed: {0}".format(str(e)))
589 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
605 cherrypy.log("Request failed: {0}".format(e))
606 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
612 raise cherrypy.HTTPError(http_client.FORBIDDEN,
630 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
635 cherrypy.log("Request failed: {0}".format(str(e)))
636 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
648 method = cherrypy.request.method
653 raise cherrypy.HTTPError(http_client.METHOD_NOT_ALLOWED,
656 # We need to prevent cherrypy from processing the request body so that
671 tar_stream = cherrypy.request.tar_stream
687 cherrypy.log("Request aborted: ",
690 cherrypy.request.tar_stream = None
705 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
710 cherrypy.log("Request failed: {0}".format(str(e)))
711 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
722 method = cherrypy.request.method
727 raise cherrypy.HTTPError(http_client.METHOD_NOT_ALLOWED,
730 # We need to prevent cherrypy from processing the request body so that
744 method = cherrypy.request.method
755 raise cherrypy.HTTPError(http_client.NOT_FOUND,
761 cherrypy.log("Request failed: {0}".format(
763 raise cherrypy.HTTPError(http_client.NOT_FOUND,
768 response = cherrypy.response
782 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
789 request = cherrypy.request
790 response = cherrypy.response
801 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
812 cherrypy.log("Request failed: {0}".format(e))
813 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
822 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
829 request = cherrypy.request
830 response = cherrypy.response
841 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
852 cherrypy.log("Request failed: {0}".format(e))
853 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
862 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
874 # cherrypy decoded it, but we actually need it encoded.
879 request = cherrypy.request
892 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
903 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
905 response = cherrypy.response
909 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
974 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
978 raise cherrypy.HTTPError(http_client.SERVICE_UNAVAILABLE,
982 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
990 # cherrypy decoded it, but we actually need it encoded.
1002 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1011 # cherrypy decoded it, but we actually need it encoded.
1022 raise cherrypy.HTTPError(http_client.BAD_REQUEST, _("The "
1026 request = cherrypy.request
1044 raise cherrypy.HTTPError(
1060 cherrypy.log("Request failed: {0}".format(str(e)))
1061 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1074 cherrypy.log("Request failed: {0}".format(str(e)))
1075 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1077 # We need to prevent cherrypy from processing the request body so that
1098 # cherrypy decoded it, but we actually need it encoded.
1104 request = cherrypy.request
1105 response = cherrypy.response
1109 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
1125 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1135 # cherrypy decoded it, but we actually need it encoded.
1141 request = cherrypy.request
1142 response = cherrypy.response
1146 raise cherrypy.HTTPError(http_client.BAD_REQUEST,
1157 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1161 @cherrypy.tools.response_headers(headers=[("Pragma", "no-cache"),
1188 cherrypy.log(err)
1189 raise cherrypy.HTTPError(http_client.NOT_FOUND, err)
1191 raise cherrypy.HTTPError(http_client.SERVICE_UNAVAILABLE,
1195 @cherrypy.tools.response_headers(headers=\
1208 cherrypy.log("Request failed: {0}".format(e))
1209 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1235 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1240 cherrypy.log("Request failed: {0}".format(str(e)))
1241 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1244 raise cherrypy.HTTPError(http_client.NOT_FOUND)
1293 @cherrypy.tools.response_headers(headers=[(
1307 cherrypy.log("Request failed: {0}".format(str(e)))
1308 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1316 cherrypy.log("Request failed: {0}".format(str(e)))
1317 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1323 @cherrypy.tools.response_headers(headers=[(
1342 cherrypy.log("Request failed: {0}".format(
1344 raise cherrypy.HTTPError(http_client.NOT_FOUND,
1353 cherrypy.log("Request failed: {0}".format(str(e)))
1354 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1380 cherrypy.log("Request failed: {0}".format(e))
1381 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1404 @cherrypy.tools.response_headers(headers=[(
1416 cherrypy.log("Request failed: {0}".format(e))
1417 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1433 raise cherrypy.HTTPError(http_client.BAD_REQUEST)
1454 raise cherrypy.HTTPError(http_client.NOT_FOUND, _("No "
1461 @cherrypy.tools.response_headers(headers=\
1475 raise cherrypy.HTTPError(http_client.NOT_FOUND, _("Unable "
1503 cherrypy.log("NASTY: return bogus or empty response")
1504 response = cherrypy.response
1547 cherrypy.log("NASTY Depot Started")
1548 cherrypy.log("NASTY nasty={0:d}, nasty_sleep={1:d}".format(
1554 cherrypy.tools.nasty_before = HandlerTool(nasty_before_handler)
1562 # reference passed by cherrypy as an input argument to our
1586 cherrypy.log("NASTY Depot Error List: {0}".format(
1611 cherrypy.log("NASTY nastiness at min")
1613 cherrypy.log("NASTY nastiness at max")
1645 cherrypy.log("NASTY: Random HTTP error: {0:d}".format(code))
1646 raise cherrypy.HTTPError(code)
1650 cherrypy.log("NASTY: sleep for {0:d} secs".format(
1654 @cherrypy.expose
1659 raise cherrypy.HTTPError(http_client.BAD_REQUEST)
1661 raise cherrypy.HTTPError(http_client.BAD_REQUEST)
1662 cherrypy.log("Nastiness set to {0:d} by client request".format(
1669 @cherrypy.tools.response_headers(headers=\
1678 cherrypy.log("NASTY versions_0: X-Ipkg-Error")
1679 response = cherrypy.response
1688 cherrypy.log("NASTY versions_0: header but no versions")
1697 cherrypy.log("NASTY versions_0: modified version #s")
1707 cherrypy.log(
1720 cherrypy.log(
1747 cherrypy.log("Request failed: {0}".format(e))
1748 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1754 raise cherrypy.HTTPError(http_client.FORBIDDEN,
1772 raise cherrypy.HTTPError(http_client.BAD_REQUEST, str(e))
1777 cherrypy.log("Request failed: {0}".format(str(e)))
1778 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1791 cherrypy.log("NASTY manifest_0: serve wrong mfst")
1820 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1825 cherrypy.log("Request failed: {0}".format(str(e)))
1826 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1839 cherrypy.log("NASTY file_0: 404 NOT_FOUND")
1840 raise cherrypy.HTTPError(http_client.NOT_FOUND)
1845 cherrypy.log("NASTY file_0: serve wrong file")
1867 raise cherrypy.HTTPError(http_client.FORBIDDEN,
1877 cherrypy.log("Request failed: {0}".format(str(e)))
1878 raise cherrypy.HTTPError(http_client.NOT_FOUND, str(e))
1891 cherrypy.log("NASTY catalog_1: wrong catalog file")
1909 cherrypy.log("NASTY search_1: HTTP {0:d}".format(code))
1910 raise cherrypy.HTTPError(code)
1920 response = cherrypy.response
1927 raise cherrypy.HTTPError(http_client.NOT_FOUND)
1943 cherrypy.log("NASTY serve_file: truncated file")
1954 cherrypy.log("NASTY serve_file: prepend garbage")
1966 cherrypy.log("NASTY serve_file: flip bits")
1990 """Bus is the cherrypy engine and gconf is a dictionary
2131 # at this URI: http://www.cherrypy.org/wiki/BuiltinPlugins