def test(): h = html.HDoc() h.addHead(html.title("Bob Page")) h.addScript("referurl_dialog.js") h.add(html.h1("Test page")) h.add(html.p("Is this working now?")) eq_("".join(h), '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>Bob Page</title>\n<script type="text/javascript" src="referurl_dialog.js"></script>\n</head>\n<body><h1>Test page</h1>\n<p>Is this working now?</p>\n</body></html>')
def single_message(): id = form["id"].value for key in db.keys(): if ("-%s-" % id) in key: post = db[key] break else: return "Unknown message: %s" % id return html.body( html.h1(html.escape(post["data"]["title"])), format_post(post), )
def list_messages(): # Which messages to show? messages = list(reversed(sorted(db.keys()))) if "start" in form: start = int(form["start"].value) else: start = 0 page_messages = messages[start:start + MESSAGES_PER_PAGE] pager = gen_pager(messages, start) return html.body( pager, html.h1("a858 auto-analysis"), credits(), html.div(*map(lambda key: format_post(db[key]), page_messages)), pager)
def list_messages(): # Which messages to show? messages = list(reversed(sorted(db.keys()))) if "start" in form: start = int(form["start"].value) else: start = 0 page_messages = messages[start:start + MESSAGES_PER_PAGE] pager = gen_pager(messages, start) return html.body( pager, html.h1("a858 auto-analysis"), html.div(*map(lambda key: format_post(db[key]), page_messages)), pager )
def review_to_html_summary(r): hexsha, review = r commits = html.ul(*map(lambda c: html.li(*commit_to_html(repo.commit(c))), review["includedCommits"])) return html.div(html.h1(html.a(hexsha[0:12], href=html.absolute("review", hexsha))), commits, **{"class": "review"})
def html(): return [ h.h1("""The Exerputer """), h.img("exerputer.png"), ]