示例#1
0
文件: html.py 项目: maximerobin/Ufwi
def htmlHeader(level, text, escape=True, **attr):
    r"""
    Level have to be in [1; 6].

    >>> htmlHeader(1, 'Document')
    <Html u'<h1>Document</h1>'>
    >>> htmlHeader(7, 'Subsection')
    <Html u'<h6>Subsection</h6>'>
    """
    tag = 'h%s' % minmax(1, level, 6)
    return _htmlTag(tag, Html(text, escape=escape), attr)
示例#2
0
def changeLogLevel(level, delta):
    return minmax(DEBUG, level + delta*10, CRITICAL)