Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix importing of "page" entries from Wordpress.
  • Loading branch information
geekman committed Dec 6, 2013
1 parent 8fa55a9 commit 6179e69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion acrylamid/tasks/imprt.py
Expand Up @@ -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

Expand All @@ -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):
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 6179e69

Please sign in to comment.