diff --git a/blogthon.cgi b/blogthon.cgi index 63d0e2f..f883bea 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -16,17 +16,17 @@ # * Complete Atom Feed (like RSS) # * Fix broken charset in outgoing mails (needs some testing) -import ConfigParser +from ConfigParser import ConfigParser import os import sys import time import locale import re import cgi -import glob -import md5 -import random -import smtplib +from smtplib import SMTP +from md5 import new as newmd5 +from glob import glob +from random import randint # A wonderful place for doing some regexp ;) no_break = re.compile('^\s*(
| | | ).*$') @@ -36,18 +36,13 @@ line_start_plus = re.compile('^\+.*$') tab = "\t" def generate_uuid(string): - string_md5sum = md5.new(string).hexdigest() + string_md5sum = newmd5(string).hexdigest() string = str.join('-', (string_md5sum[0:8], string_md5sum[8:12], string_md5sum[12:16], string_md5sum[16:20], string_md5sum[20:32])) return string def errorpage(string): - print 'Content-type: text/html\n' - print '' - print '' - print ' ' - print tab + ''
print tab*3 + ' '
print tab*2 + ''
@@ -544,8 +540,8 @@ else:
# Form for adding comments
if comments == "True":
- random_int_a = random.randint(1,9)
- random_int_b = random.randint(1,9)
+ random_int_a = randint(1,9)
+ random_int_b = randint(1,9)
cquizv = random_int_a + random_int_b
print tab*3 + '' + blog_locale[0] + ' '
@@ -500,10 +496,10 @@ else:
# Comments...
# ... are shown when post_display and comments_file isn't false
- comments_file = glob.glob(entries_dir + title + '.comments')
+ comments_file = glob(entries_dir + title + '.comments')
if post_display:
if comments_file:
- comments_file = glob.glob(entries_dir + title + '.comments')
+ comments_file = glob(entries_dir + title + '.comments')
comments_content = open(comments_file[0], "r")
print tab*3 + ''
print tab*4 + ' |
---|