Added exception for not writable commentsfile
This commit is contained in:
parent
dc381f921e
commit
0d757b0522
@ -189,6 +189,7 @@ if cname and ctext and ctitle:
|
|||||||
except:
|
except:
|
||||||
errorpage('not writable entries_dir')
|
errorpage('not writable entries_dir')
|
||||||
comments_file = glob.glob(entries_dir + ctitle + '.comments')
|
comments_file = glob.glob(entries_dir + ctitle + '.comments')
|
||||||
|
try:
|
||||||
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")
|
||||||
@ -204,6 +205,8 @@ if cname and ctext and ctitle:
|
|||||||
smtp.login(smtp_user, smtp_pass)
|
smtp.login(smtp_user, smtp_pass)
|
||||||
smtp.sendmail(blog_title, mail_to, msg)
|
smtp.sendmail(blog_title, mail_to, msg)
|
||||||
smtp.quit()
|
smtp.quit()
|
||||||
|
except:
|
||||||
|
errorpage('commentsfile seems not to be writable!)
|
||||||
|
|
||||||
# Read entries and store their title and timestamp
|
# Read entries and store their title and timestamp
|
||||||
entries = []
|
entries = []
|
||||||
|
Loading…
Reference in New Issue
Block a user