mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
One empty line moved from Entry.__str__ to Journal.write
This commit is contained in:
parent
beaebbb562
commit
e2559ecf93
1 changed files with 2 additions and 2 deletions
4
jrnl.py
4
jrnl.py
|
@ -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):
|
||||||
|
|
Loading…
Add table
Reference in a new issue