def edit(page): s = open(page).read() if os.path.exists(page) else "" s = '<form method="post" action="?save">' \ '<textarea name="content" rows="10" cols="80">%s</textarea><br>' \ '<input type="submit">' \ '</form>' % s return template(wiki, name=name(page), content=s)
def view(page): print displayname(page) return template(wiki, name=name(page), content=open(page).read())