Comments:

* Bugfix when sending more then one line ;)
This commit is contained in:
Stefan Ritter 2009-03-08 20:20:18 +01:00
parent eb925c9037
commit b2bc8d5a06
1 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,9 @@ if cname and ctext and ctitle:
content = open(comments_file[0], "a+") content = open(comments_file[0], "a+")
content.write("-." + cname + "\n") content.write("-." + cname + "\n")
content.write("+." + time.asctime() + "\n") content.write("+." + time.asctime() + "\n")
content.write("." + ctext + "\n") ctext = ctext.split("\n")
for line in ctext:
content.write("." + line + "\n")
content.close() content.close()
print 'Content-type: text/html\n' print 'Content-type: text/html\n'
@ -193,7 +195,7 @@ else: # Show regular entry
print ' <form method="post">' print ' <form method="post">'
print ' <input type="hidden" name="ctitle" value="' + title + '">' print ' <input type="hidden" name="ctitle" value="' + title + '">'
print ' <label for="cname">name:</label><input type="text" id="cname" name="cname">' print ' <label for="cname">name:</label><input type="text" id="cname" name="cname">'
print ' <br /><label for="ctext">text:</label><textarea rows="5" id="ctext" name="ctext" wrap="hard"></textarea>' print ' <br /><label for="ctext">text:</label><textarea rows="5" id="ctext" name="ctext"></textarea>'
print ' <br /><input type="submit" id="submit" value="post comment">' print ' <br /><input type="submit" id="submit" value="post comment">'
print ' </form>' print ' </form>'