One empty line moved from Entry.__str__ to Journal.write

This commit is contained in:
Manuel Ebert 2012-04-05 12:14:52 +02:00
parent beaebbb562
commit e2559ecf93

View file

@ -33,7 +33,7 @@ class Entry:
date_str = self.date.strftime(self.journal.config['timeformat']) date_str = self.date.strftime(self.journal.config['timeformat'])
body_wrapper = "\n" if self.body else "" body_wrapper = "\n" if self.body else ""
body = body_wrapper + self.body.strip() body = body_wrapper + self.body.strip()
space = "\n\n" space = "\n"
return "%(date)s %(title)s %(body)s %(space)s" % { return "%(date)s %(title)s %(body)s %(space)s" % {
'date': date_str, 'date': date_str,
@ -105,7 +105,7 @@ class Journal:
filename = filename or self.config['journal'] filename = filename or self.config['journal']
journal_file = open(filename, 'w') journal_file = open(filename, 'w')
for entry in self.entries: for entry in self.entries:
journal_file.write(str(entry)) journal_file.write(str(entry)+"\n")
journal_file.close() journal_file.close()
def sort(self): def sort(self):