Get rid of deprecation warning

This commit is contained in:
Sam Ruby 2010-05-20 15:12:30 -04:00
parent 084bb5307e
commit cc1118100b

View File

@ -18,10 +18,15 @@
# sidebar = @class='sidebar' # sidebar = @class='sidebar'
# #
import glob, libxml2, os, time, sys, sgmllib, urllib2, urlparse, re, md5 import glob, libxml2, os, time, sys, sgmllib, urllib2, urlparse, re
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from htmlentitydefs import entitydefs from htmlentitydefs import entitydefs
try:
from hashlib import md5
except:
from md5 import new as md5
import planet import planet
from planet import config from planet import config
from planet.spider import filename from planet.spider import filename
@ -467,7 +472,7 @@ for i in range(0,len(weighted_links)):
tagbase = config.link().split('/') tagbase = config.link().split('/')
if not tagbase[-1]: tagbase = tagbase[:-1] if not tagbase[-1]: tagbase = tagbase[:-1]
tagbase = 'tag:%s,2007:%smeme/%%s' % (tagbase[2],'/'.join(tagbase[3:])) tagbase = 'tag:%s,2007:%smeme/%%s' % (tagbase[2],'/'.join(tagbase[3:]))
entry.newTextChild(None, 'id', tagbase % md5.new(link).hexdigest()) entry.newTextChild(None, 'id', tagbase % md5(link).hexdigest())
entry.newTextChild(None, 'title', entry_title.encode('utf-8')) entry.newTextChild(None, 'title', entry_title.encode('utf-8'))
meme_link = entry.newTextChild(None, 'link', None) meme_link = entry.newTextChild(None, 'link', None)
meme_link.setProp('href', link) meme_link.setProp('href', link)