pep8
This commit is contained in:
parent
6ad5d4e6cb
commit
63808cbbb2
@ -7,6 +7,7 @@ from lxml import etree
|
|||||||
|
|
||||||
COMMENT_DIR = 'comments'
|
COMMENT_DIR = 'comments'
|
||||||
|
|
||||||
|
|
||||||
def wp2comments(xml):
|
def wp2comments(xml):
|
||||||
|
|
||||||
# xmlfile = open(xml, encoding='utf-8', mode='r').read()
|
# xmlfile = open(xml, encoding='utf-8', mode='r').read()
|
||||||
@ -24,7 +25,8 @@ def wp2comments(xml):
|
|||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
title = item.find('title')
|
title = item.find('title')
|
||||||
if title is None: continue
|
if title is None:
|
||||||
|
continue
|
||||||
|
|
||||||
# Only fetch comments from published posts.
|
# Only fetch comments from published posts.
|
||||||
status = item.find('wp:status', namespaces=root.nsmap)
|
status = item.find('wp:status', namespaces=root.nsmap)
|
||||||
@ -69,6 +71,7 @@ def wp2comments(xml):
|
|||||||
f.write(u'Date: %s\n' % (date, ))
|
f.write(u'Date: %s\n' % (date, ))
|
||||||
f.write(u'Author_Email: %s\n' % (email, ))
|
f.write(u'Author_Email: %s\n' % (email, ))
|
||||||
f.write(u'Author_IP: %s\n' % (ip, ))
|
f.write(u'Author_IP: %s\n' % (ip, ))
|
||||||
|
f.write(u'Web: %s\n' % (url, ))
|
||||||
f.write(u'\n%s\n' % (content, ))
|
f.write(u'\n%s\n' % (content, ))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user