Permalink
Browse files

Get rid of deprecation warning

  • Loading branch information...
1 parent 084bb53 commit cc1118100bcb23214b420aa865a75681d4c6a1c9 @rubys committed May 20, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 filters/mememe.plugin
View
@@ -18,10 +18,15 @@
# 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 htmlentitydefs import entitydefs
+try:
+ from hashlib import md5
+except:
+ from md5 import new as md5
+
import planet
from planet import config
from planet.spider import filename
@@ -467,7 +472,7 @@ for i in range(0,len(weighted_links)):
tagbase = config.link().split('/')
if not tagbase[-1]: tagbase = tagbase[:-1]
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'))
meme_link = entry.newTextChild(None, 'link', None)
meme_link.setProp('href', link)

0 comments on commit cc11181

Please sign in to comment.