Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Manual merge of #29

  • Loading branch information...
commit 550279083bc5903bf2bd203981d0b24c177b5e48 1 parent e757b66
@thomasf authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 exitwp.py
View
14 exitwp.py
@@ -128,10 +128,11 @@ def gi(q, unicode_wrap=True):
'type': gi('wp:post_type'),
'wp_id': gi('wp:post_id'),
'parent': gi('wp:post_parent'),
+ 'comments': gi('wp:comment_status') == u'open',
'taxanomies': export_taxanomies,
'body': body,
'img_srcs': img_srcs
- }
+ }
export_items.append(export_item)
@@ -254,10 +255,11 @@ def get_attachment_path(src, dir, dir_prefix='a'):
sys.stdout.flush()
out = None
yaml_header = {
- 'title': i['title'],
- 'date': datetime.strptime(i['date'], '%Y-%m-%d %H:%M:%S'),
- 'slug': i['slug'],
- 'wordpress_id': int(i['wp_id']),
+ 'title': i['title'],
+ 'date': datetime.strptime(i['date'], '%Y-%m-%d %H:%M:%S'),
+ 'slug': i['slug'],
+ 'wordpress_id': int(i['wp_id']),
+ 'comments': i['comments'],
}
if i['status'] != u'publish':
yaml_header['published'] = False
@@ -291,7 +293,7 @@ def get_attachment_path(src, dir, dir_prefix='a'):
try:
urlretrieve(urljoin(data['header']['link'],
img.decode('utf-8')),
- get_attachment_path(img, i['uid']))
+ get_attachment_path(img, i['uid']))
except:
print "\n unable to download " + urljoin(data['header']['link'], img.decode('utf-8'))
Please sign in to comment.
Something went wrong with that request. Please try again.