Ejemplo n.º 1
0
Archivo: main.py Proyecto: mcaudy/tubes
def notice_to_html(notice):
    """return a html object from a notice
    """
    return h.div(
            h.div(h.em(notice.author), ": ", notice.title,
                class_='notice-title'),
            h.div(notice.body, class_='notice-body'), class_='notice')
Ejemplo n.º 2
0
Archivo: main.py Proyecto: mcaudy/tubes
def show_user(request, username):
    div = h.div(class_='user-profile')
    html = h.html(h.head(h.title('user profile')), h.body(div))

    if username in users:
        user = users[username]
        div.add(h.div(username, h.em('(', user.mail, ')'), class_='user'))
        return str(html)

    return tubes.Response('nothing to see here, please move along', 404)