From 75263fa852fae5ed6e591c18fe1afad8fe5a7b0f Mon Sep 17 00:00:00 2001 From: Lingzhu Xiang Date: Sun, 5 May 2013 02:09:24 +0800 Subject: [PATCH] Fix importing Tumblr photo caption Besides each photo's caption, the general caption is also needed. While we're at it, also add a linefeed at the end of file. --- pelican/tools/pelican_import.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 5f637c73..3c40dd56 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -370,6 +370,7 @@ def tumblr2fields(api_key, blogname): else: fmtstr = '%s' content = '\n'.join(fmtstr % (photo.get('caption'), photo.get('original_size').get('url')) for photo in post.get('photos')) + content += '\n\n' + post.get('caption') elif type == 'quote': if format == 'markdown': fmtstr = '\n\n— %s' @@ -398,6 +399,8 @@ def tumblr2fields(api_key, blogname): title = post.get('question') content = '

%s: %s

\n%s' % (post.get('asking_name'), post.get('asking_url'), post.get('question'), post.get('answer')) + content = content.rstrip() + '\n' + yield (title, content, slug, date, post.get('blog_name'), [type], tags, format) offset += len(posts)