Better style in Entry.py

This commit is contained in:
Aaron Lichtman 2019-11-06 23:06:55 +01:00
parent 6145682a29
commit baa3ffbebd
No known key found for this signature in database
GPG key ID: 22368077DE9F9903

View file

@ -84,7 +84,7 @@ class Entry:
self.journal.config['colors']['date']) self.journal.config['colors']['date'])
if not short and self.journal.config['linewrap']: if not short and self.journal.config['linewrap']:
# Color date and color / bold title # Color date / title and bold title
title = ansiwrap.fill(date_str + " " + title = ansiwrap.fill(date_str + " " +
highlight_tags_maintain_background_color(self, highlight_tags_maintain_background_color(self,
self.title, self.title,
@ -102,14 +102,13 @@ class Entry:
initial_indent=indent, initial_indent=indent,
subsequent_indent=indent, subsequent_indent=indent,
drop_whitespace=True) or indent drop_whitespace=True) or indent
for line in body.splitlines() for line in body.rstrip(" \n").splitlines()
]) ])
else: else:
title = date_str + " " + \ title = date_str + " " + highlight_tags_maintain_background_color(self,
highlight_tags_maintain_background_color(self, self.title.rstrip("\n"),
self.title.rstrip("\n"), self.journal.config['colors']['title'],
self.journal.config['colors']['title'], bold=True)
bold=True)
body = highlight_tags_maintain_background_color(self, body = highlight_tags_maintain_background_color(self,
self.body.rstrip("\n "), self.body.rstrip("\n "),
self.journal.config['colors']['body'], self.journal.config['colors']['body'],