コード例 #1
0
def _exchange_marker(exchange):
    if exchange.request:
        marker = u'------------ request: %s %s' % (printable(
            exchange.request.method), printable(exchange.request.target))
    elif exchange.responses:
        marker = u'------------ unknown request'
    else:
        marker = u'------------'
    # The number 79 fits the default ``cmd.exe`` size in Windows.
    return ellipsize(marker, 79) + u'\n'
コード例 #2
0
ファイル: text.py プロジェクト: dfirst/httpolice
def _exchange_marker(exchange, req_i):
    if exchange.request:
        marker = u'------------ request %d : %s %s' % (
            req_i,
            printable(exchange.request.method),
            printable(exchange.request.target))
    elif exchange.responses:
        marker = u'------------ unknown request'
    else:
        marker = u'------------'
    return ellipsize(marker, 80) + u'\n'
コード例 #3
0
ファイル: text.py プロジェクト: vfaronov/httpolice
def _exchange_marker(exchange):
    if exchange.request:
        marker = u'------------ request: %s %s' % (
            printable(exchange.request.method),
            printable(exchange.request.target))
    elif exchange.responses:
        marker = u'------------ unknown request'
    else:
        marker = u'------------'
    # The number 79 fits the default ``cmd.exe`` size in Windows.
    return ellipsize(marker, 79) + u'\n'
コード例 #4
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'
コード例 #5
0
def _response_marker(response):
    return ellipsize(u'------------ response: %d %s' % (
                        response.status,
                        printable(find_reason_phrase(response)))) + u'\n'