aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2011-02-07 23:06:10 +0100
committerStefan Ritter <xeno@thehappy.de>2011-02-07 23:11:09 +0100
commit50e5c532f7792fd5eeacb4b4106a4e8e785776a0 (patch)
treebafd091f022324cd6d7ad7692dd93a30d1d03399 /blogthon.cgi
parentc46d21939017545cc1dd038e732fd868b4d1350b (diff)
Remove exceptions for entries_dir
Diffstat (limited to '')
-rwxr-xr-xblogthon.cgi36
1 files changed, 15 insertions, 21 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index 4f35d81..1fa1498 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -216,30 +216,24 @@ if cname and ctext and ctitle:
else:
comments_file = os.path.join(entries_dir, ctitle + ".comments")
if not os.path.exists(comments_file):
- try:
- content = open(comments_file, "w")
- content.close()
- except:
- errorpage("\"%s\" isn\'t writable!" % entries_dir)
-
- try:
- content = open(comments_file, "a")
- content.write("-." + cname + "\n")
- content.write("+." + time.strftime("%c", time.localtime()) + "\n")
- ctext = ctext.split("\n")
- for line in ctext:
- content.write("." + line + "\n")
+ content = open(comments_file, "w")
content.close()
- # Send mail?
- if not new_comment_mail == "False":
- msg = "From: Blogthon\nTo: %s\nSubject: New comment on %s\n\nSomeone wrote a comment to this entry: %s?p=%s" % (mail_to, blog_title, blog_url, ctitle.replace(" ", "-"))
- smtp = SMTP(smtp_host)
- smtp.starttls()
- smtp.sendmail(blog_title, mail_to, msg)
+ content = open(comments_file, "a")
+ content.write("-." + cname + "\n")
+ content.write("+." + time.strftime("%c", time.localtime()) + "\n")
+ ctext = ctext.split("\n")
+ for line in ctext:
+ content.write("." + line + "\n")
+ content.close()
+
+ # Send mail?
+ if not new_comment_mail == "False":
+ msg = "From: Blogthon\nTo: %s\nSubject: New comment on %s\n\nSomeone wrote a comment to this entry: %s?p=%s" % (mail_to, blog_title, blog_url, ctitle.replace(" ", "-"))
+ smtp = SMTP(smtp_host)
+ smtp.starttls()
+ smtp.sendmail(blog_title, mail_to, msg)
smtp.quit()
- except:
- errorpage("Comment cannot be written!")
# Read entries and store their title and timestamp
entries = []