Skip to content

Commit 487fdc4

Browse files
committedJul 12, 2015
Fixed little bug, and moved code to better place.
1 parent 1a7c983 commit 487fdc4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

Diff for: ‎nikola/plugins/command/import_wordpress.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def populate_context(self, channel):
415415
context['PAGES'] = PAGES
416416
COMPILERS = '{\n'
417417
COMPILERS += ''' "rest": ('.txt', '.rst'),''' + '\n'
418-
COMPILERS += ''' "markdown": ('.md', '.mdown', '.markdown')''' + '\n'
418+
COMPILERS += ''' "markdown": ('.md', '.mdown', '.markdown'),''' + '\n'
419419
COMPILERS += ''' "html": ('.html', '.htm'),''' + '\n'
420420
if self.use_wordpress_compiler:
421421
COMPILERS += ''' "wordpress": ('.wp'),''' + '\n'
@@ -842,6 +842,10 @@ def process_item_if_attachment(self, item):
842842
else:
843843
LOGGER.warn("Attachment #{0} ({1}) has no parent!".format(post_id, files))
844844

845+
def write_attachments_info(self, path, attachments):
846+
with io.open(path, "wb") as file:
847+
file.write(json.dumps(attachments).encode('utf-8'))
848+
845849
def process_item_if_post_or_page(self, item):
846850
wordpress_namespace, post_type, post_id, parent_id = self._extract_item_info(item)
847851

@@ -861,10 +865,6 @@ def process_item_if_post_or_page(self, item):
861865
out_folder_slug[1] + ".attachments.json")
862866
self.write_attachments_info(destination, attachments)
863867

864-
def write_attachments_info(self, path, attachments):
865-
with io.open(path, "wb") as file:
866-
file.write(json.dumps(attachments).encode('utf-8'))
867-
868868
def import_posts(self, channel):
869869
self.attachments = defaultdict(dict)
870870
# First process attachments

0 commit comments

Comments
 (0)