Made indent character configurable. Looks nice with │ (BOX DRAWINGS LIGHT VERTICAL)

This commit is contained in:
Philip Douglass 2015-08-28 12:19:29 -04:00
parent 1ea5255aa0
commit 8c5c47f2ca
2 changed files with 4 additions and 2 deletions

View file

@ -50,8 +50,9 @@ class Entry:
body = "\n".join([ body = "\n".join([
textwrap.fill(line, textwrap.fill(line,
self.journal.config['linewrap'], self.journal.config['linewrap'],
initial_indent="| ", initial_indent=self.journal.config['indent'] + " ",
subsequent_indent="| ") or "|" subsequent_indent=self.journal.config['indent'] + " ")
or self.journal.config['indent']
for line in self.body.rstrip(" \n").splitlines() for line in self.body.rstrip(" \n").splitlines()
]) ])
else: else:

View file

@ -29,6 +29,7 @@ class Journal(object):
'tagsymbols': '@', 'tagsymbols': '@',
'highlight': True, 'highlight': True,
'linewrap': 80, 'linewrap': 80,
'indent': "|"
} }
self.config.update(kwargs) self.config.update(kwargs)
# Set up date parser # Set up date parser