예제 #1
0
파일: html.py 프로젝트: dfirst/httpolice
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)
예제 #2
0
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)
예제 #3
0
파일: html.py 프로젝트: vfaronov/httpolice
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)
예제 #4
0
파일: html.py 프로젝트: weijl6819/httpolice
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)
예제 #5
0
파일: text.py 프로젝트: dfirst/httpolice
def _response_marker(response, resp_i):
    return ellipsize(u'------------ response %d : %d %s' % (
                        resp_i,
                        response.status,
                        printable(find_reason_phrase(response)))) + u'\n'
예제 #6
0
def _response_marker(response):
    return ellipsize(u'------------ response: %d %s' % (
                        response.status,
                        printable(find_reason_phrase(response)))) + u'\n'