Indent character optional

This commit is contained in:
Manuel Ebert 2016-08-19 21:44:01 +00:00
parent bdc9dc598d
commit 6a53da5efd

View file

@ -74,7 +74,10 @@ class Entry:
"""Returns a pretty-printed version of the entry. """Returns a pretty-printed version of the entry.
If short is true, only print the title.""" If short is true, only print the title."""
date_str = self.date.strftime(self.journal.config['timeformat']) date_str = self.date.strftime(self.journal.config['timeformat'])
indent = self.journal.config['indent_character'].rstrip() + " " if self.journal.config['indent_character']:
indent = self.journal.config['indent_character'].rstrip() + " "
else:
indent = ""
if not short and self.journal.config['linewrap']: if not short and self.journal.config['linewrap']:
title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap']) title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap'])
body = "\n".join([ body = "\n".join([