예제 #1
0
파일: html.py 프로젝트: dfirst/httpolice
def _notice_to_html(the_notice, ctx, with_anchor=False):
    anchor = {'id': six.text_type(the_notice.id)} if with_anchor else {}
    with H.div(_class=u'notice %s' % the_notice.severity, **anchor):
        with H.h3():
            # See above regarding spaces.
            H.abbr(the_notice.severity_short, _class=u'severity',
                   title=the_notice.severity)
            H.span(six.text_type(the_notice.id), _class=u'ident')
            with H.span():
                _piece_to_html(the_notice.title, ctx)
        for piece in the_notice.explanation:
            _piece_to_html(piece, ctx)
예제 #2
0
파일: html.py 프로젝트: weijl6819/httpolice
def _notice_to_html(the_notice, ctx, with_anchor=False):
    anchor = {'id': str(the_notice.id)} if with_anchor else {}
    with H.div(_class=u'notice %s' % the_notice.severity.name, **anchor):
        with H.h3():
            # See above regarding spaces.
            H.abbr(the_notice.severity_short,
                   _class=u'severity',
                   title=the_notice.severity.name)
            H.span(str(the_notice.id), _class=u'ident')
            with H.span(__pretty=False):
                _piece_to_html(the_notice.title, ctx)
        for piece in the_notice.explanation:
            _piece_to_html(piece, ctx)