/venus

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/venus/

« back to all changes in this revision

Viewing changes to planet/reconstitute.py

  • Committer: Jacques Distler
  • Date: 2009-01-05 02:55:13 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20090105025513-djk2unyyct87mn9x
Use hashlib instead of md5
  
Python 2.6 complains about md5.
Hashlib works for  python >= 2.5.

Show diffs side-by-side

added added

removed removed

13
13
Todo:
14
14
  * extension elements
15
15
"""
16
 
import re, time, md5, sgmllib
 
16
import re, time, hashlib, sgmllib
17
17
from xml.sax.saxutils import escape
18
18
from xml.dom import minidom, Node
19
19
from html5lib import liberalxmlparser
68
68
        entry_id = entry.link
69
69
    elif entry.has_key("title") and entry.title:
70
70
        entry_id = (entry.title_detail.base + "/" +
71
 
            md5.new(entry.title).hexdigest())
 
71
            hashlib.md5(entry.title).hexdigest())
72
72
    elif entry.has_key("summary") and entry.summary:
73
73
        entry_id = (entry.summary_detail.base + "/" +
74
 
            md5.new(entry.summary).hexdigest())
 
74
            hashlib.md5(entry.summary).hexdigest())
75
75
    elif entry.has_key("content") and entry.content:
76
76
 
77
77
        entry_id = (entry.content[0].base + "/" + 
78
 
            md5.new(entry.content[0].value).hexdigest())
 
78
            hashlib.md5(entry.content[0].value).hexdigest())
79
79
    else:
80
80
        return
81
81