Skip to content

Commit

Permalink
Rename common.displaypost to common.print_post.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Morgan committed Feb 8, 2009
1 parent 3f9c80d commit cc8b142
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common.py
Expand Up @@ -45,7 +45,7 @@ def printheaders(title):
print '<link href="default.css" rel="stylesheet" type="text/css">'
print '</head>'

def displaypost(title, body, date=None):
def print_post(title, body, date=None):
"""Formats and prints a post"""
print '<div class="blogpost">'
print '<h1>%s</h1>' % title
Expand Down
4 changes: 2 additions & 2 deletions index.cgi
Expand Up @@ -39,7 +39,7 @@ else:
if form.has_key("id"):
if common.getnumposts(conn, form.getvalue("id")) > 0:
(title, text, date) = conn.execute("SELECT title, text, date FROM entries WHERE id = ?", (form.getvalue("id"),)).fetchone()
common.displaypost(title, text, date)
common.print_post(title, text, date)
else:
print "<p>No such post.</p>"
else:
Expand All @@ -48,7 +48,7 @@ else:
offset = int(form.getvalue("offset"))
for (postid, title, text, date) in conn.execute("SELECT id, title, text, date FROM entries ORDER BY date DESC LIMIT ? OFFSET ?", (config.NUMPOSTS, offset)):
title = '<a href="index.cgi?id=%s">%s</a>' % (postid, title)
common.displaypost(title, text, date)
common.print_post(title, text, date)

# Only print the navigation bar if the number of posts exceeds
# the number to be displayed per page.
Expand Down
2 changes: 1 addition & 1 deletion post.cgi
Expand Up @@ -76,7 +76,7 @@ if form.has_key("preview"):
# one.
if form.has_key("update"):
print '<input type="hidden" name="update" value="%s">' % form.getvalue("update")
common.displaypost(edit_title, edit_text)
common.print_post(edit_title, edit_text)

print '<div id="editingControls">'
print '<input name="title" id="posttitle" type="text" value="%s">' % cgi.escape(edit_title, True)
Expand Down

0 comments on commit cc8b142

Please sign in to comment.