def _render_response(resp): with H.section(): with H.div(_class=u'message-display'): with H.h2(), H.code(): # Status line # See above regarding spaces. if resp.version: H.span(printable(resp.version), **_for_object(resp.version)) with H.span(**_for_object(resp.status)): _render_known(resp.status) H.span(printable(find_reason_phrase(resp))) _render_message(resp) # Headers, body and all that _render_complaints(resp)
def _render_response(resp): with H.section(): with H.div(_class=u'message-display'): if resp.remark: H.p(printable(resp.remark), _class=u'message-remark') with H.h2(), H.code(): # Status line # See above regarding spaces. if resp.version: H.span(printable(resp.version), **_for_object(resp.version)) with H.span(**_for_object(resp.status)): _render_known(resp.status) H.span(printable(find_reason_phrase(resp))) _render_message(resp) # Headers, body and all that _render_complaints(resp)
def _render_response(resp): with H.section(): with H.div(_class=u'message-display'): if resp.remark: H.p(printable(resp.remark), _class=u'message-remark') with H.h2(), H.code(): # Status line # See above regarding spaces. if resp.version: H.span(printable(resp.version), **_for_object(resp.version)) # httpolice-devtool (the Chrome extension) relies # on the ``StatusCode`` class. Avoid breaking it, at least # as long as it doesn't inconvenience HTTPolice itself. with H.span(**_for_object(resp.status, u'StatusCode')): _render_known(resp.status) text_node(u' ' + printable(find_reason_phrase(resp))) _render_message(resp) # Headers, body and all that _render_complaints(resp)
def _response_marker(response, resp_i): return ellipsize(u'------------ response %d : %d %s' % ( resp_i, response.status, printable(find_reason_phrase(response)))) + u'\n'
def _response_marker(response): return ellipsize(u'------------ response: %d %s' % ( response.status, printable(find_reason_phrase(response)))) + u'\n'