fix disqus import

This commit is contained in:
Martin Zimmermann 2013-09-08 17:37:26 +02:00
parent aecab5cf01
commit 20f82dcfcd

View File

@ -12,6 +12,7 @@ from __future__ import division
import sys import sys
import os import os
import hashlib
from time import mktime, strptime from time import mktime, strptime
from urlparse import urlparse from urlparse import urlparse
@ -35,10 +36,11 @@ def insert(db, thread, comments):
parent = remap.get(item.get('dsq:parent')) parent = remap.get(item.get('dsq:parent'))
comment = Comment(created=item['created'], text=item['text'], comment = Comment(created=item['created'], text=item['text'],
author=item['author'], email=item['email'], parent=parent) author=item['author'], parent=parent,
hash=hashlib.md5(item["email"] or '').hexdigest())
rv = db.add(path, comment) rv = db.add(path, comment, '127.0.0.1')
remap[item['dsq:id']] = rv.id remap[item['dsq:id']] = rv["id"]
def disqus(db, xmlfile): def disqus(db, xmlfile):