From b355b89f4a5239e56f469637e2a699c2386a4dc1 Mon Sep 17 00:00:00 2001 From: Terence Simpson Date: Thu, 4 Feb 2010 19:01:11 +0000 Subject: [PATCH] And the rest --- Encyclopedia/plugin.py | 4 ++-- commoncgi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Encyclopedia/plugin.py b/Encyclopedia/plugin.py index ec1009d..23570a5 100644 --- a/Encyclopedia/plugin.py +++ b/Encyclopedia/plugin.py @@ -21,7 +21,7 @@ import supybot.ircdb as ircdb import supybot.conf as conf import supybot.utils as utils import supybot.ircutils as ircutils -import sys, os, re, md5, random, time +import sys, os, re, hashlib, random, time if sys.version_info >= (2, 5, 0): import re @@ -909,7 +909,7 @@ class Encyclopedia(callbacks.Plugin): return cur = db.cursor() - sessid = md5.new('%s%s%d' % (msg.prefix, time.time(), random.randint(1,100000))).hexdigest() + sessid = hashlib.md5('%s%s%d' % (msg.prefix, time.time(), random.randint(1,100000))).hexdigest() cur.execute("INSERT INTO sessions (session_id, user, time) VALUES (%s, %s, %d)", (sessid, msg.nick, int(time.mktime(time.gmtime())) )) db.commit() diff --git a/commoncgi.py b/commoncgi.py index f2d2d5a..4e9ba65 100644 --- a/commoncgi.py +++ b/commoncgi.py @@ -12,7 +12,7 @@ # ### -import cgi, cgitb, re, sys, math, os, md5, sqlite, random, time, datetime, pytz, Cookie, StringIO, urllib2 +import cgi, cgitb, re, sys, math, os, hashlib, sqlite, random, time, datetime, pytz, Cookie, StringIO, urllib2 import cPickle as pickle cgitb.enable()