Use Unicode strings

and convert to .format()
This commit is contained in:
William Minchin 2014-08-05 11:20:49 -06:00
parent 115a5c705d
commit dcfd15fb6a

View file

@ -68,14 +68,13 @@ def to_txt(journal):
def to_pelican(entry): def to_pelican(entry):
"""Returns a markdown representation of the Journal with Pelican formatted """Returns a markdown representation of the Journal with Pelican formatted
front matter""" front matter"""
out = '' out = u''
out = out + 'Title: ' + entry.title + '\n' out += u'Title: {}\n'.format(entry.title)
out = out + 'Date: ' + str(entry.date) + '\n' out += u'Date: {}\n'.format(str(entry.date))
if entry.tags: if entry.tags:
# drop tag symbol # drop tag symbol
out = out + 'Tags: ' + ', '.join([tag[1:] for tag in entry.tags]) + '\n' out += u'Tags: {}\n'.format(', '.join([tag[1:] for tag in entry.tags]))
out += '\n' out += u'\n{}'.format(entry.body)
out += entry.body
return out return out