Permalink
Browse files

Merge pull request #192 from geekman/master

Fix importing of "page" entries
  • Loading branch information...
posativ committed Dec 6, 2013
2 parents 8fa55a9 + 6179e69 commit 7a0f86b62067a8182c4083b5d31f2b7fa6ab3e70
Showing with 6 additions and 1 deletion.
  1. +6 −1 acrylamid/tasks/imprt.py
View
@@ -255,6 +255,9 @@ def generate(item):
# attachment, nav_menu_item, page, post
entry['type'] = item.find('%spost_type' % wpns).text
+ if entry['type'] == 'post':
+ entry['type'] = 'entry'
+
if item.find('%sstatus' % wpns).text != 'publish':
entry['draft'] = True
@@ -279,7 +282,7 @@ def generate(item):
if tree.find('channel/%swxr_version' % wpns) is None:
continue
entries = list(map(generate, tree.findall('channel/item')))
- return defaults, [entry for entry in entries if entry['type'] in ('page', 'post')]
+ return defaults, [entry for entry in entries if entry['type'] in ('page', 'entry')]
def fetch(url, auth=None):
@@ -346,6 +349,8 @@ def create(defaults, item):
f.write(u'tags: [%s]\n' % ', '.join(item['tags']))
if 'permalink' in item:
f.write(u'permalink: %s\n' % item['permalink'])
+ if item.get('type', 'entry') != 'entry':
+ f.write(u'type: %s\n' % item['type'])
for arg in options.args:
f.write(arg.strip() + u'\n')
f.write(u'---\n\n')

0 comments on commit 7a0f86b

Please sign in to comment.