modifying the thetvdb python api to use the correct libraries for python 2.4.5

This commit is contained in:
Erik Kristensen 2010-10-17 20:33:12 -04:00
parent f866e571ed
commit f467aa1ac5
1 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@
urllib2 caching handler
Modified from http://code.activestate.com/recipes/491261/
"""
from __future__ import with_statement
#from __future__ import with_statement
__author__ = "dbr/Ben"
__version__ = "1.2.1"
@ -20,8 +20,9 @@ import time
import errno
import httplib
import urllib2
import String
import StringIO
from hashlib import md5
import md5
from threading import RLock
cache_lock = RLock()
@ -39,7 +40,7 @@ def locked_function(origfunc):
def calculate_cache_path(cache_location, url):
"""Checks if [cache_location]/[hash_of_url].headers and .body exist
"""
thumb = md5(url).hexdigest()
thumb = md5.new(url).hexdigest()
header = os.path.join(cache_location, thumb + ".headers")
body = os.path.join(cache_location, thumb + ".body")
return header, body