Example #1
0
File: main.py Project: mcaudy/tubes
def show_notice(request, uid):
    if uid in notices:
        notice = notices[uid]
        div = h.div(notice_to_html(notice), id='timeline')
        css = h.css('/files/style.css')
        html = h.html(h.head(h.title('notices'), css), h.body(div))
        return str(html)

    return tubes.Response('nothing to see here, please move along', 404)
Example #2
0
File: main.py Project: mcaudy/tubes
def get_new_notices(request):
    css = h.css('/files/style.css')
    div = h.div(id='timeline')
    html = h.html(h.head(h.title('notices'), css), h.body(div))

    try:
        while True:
            notice = new_notices.get(0, False)
            div.add(notice_to_html(notice))
    except Queue.Empty:
        pass

    return str(html)
Example #3
0
File: main.py Project: mcaudy/tubes
def show_stream(request, username):
    if username == '':
        notices = stream
    elif username in user_notices:
        notices = user_notices[username]
    else:
        return tubes.Response('nothing to see here, please move along', 404)

    content = [notice_to_html(notices) for notice in notices]
    css = h.css('/files/style.css')
    html = h.html(h.head(h.title('notices'), css), h.body(*content))

    return str(html)