--export text doesn't indent

Fixes #373
This commit is contained in:
Manuel Ebert 2015-12-28 13:06:26 -08:00
parent b2542db5e5
commit 849dc89557
2 changed files with 6 additions and 2 deletions

View file

@ -36,6 +36,10 @@ class Journal(object):
"""Returns the number of entries"""
return len(self.entries)
def __iter__(self):
"""Iterates over the journal's entries."""
return (entry for entry in self.entries)
@classmethod
def from_journal(cls, other):
"""Creates a new journal by copying configuration and entries from

View file

@ -17,12 +17,12 @@ class TextExporter(BaseExporter):
@classmethod
def export_entry(cls, entry):
"""Returns a unicode representation of a single entry."""
return u.__unicode__()
return entry.__unicode__()
@classmethod
def export_journal(cls, journal):
"""Returns a unicode representation of an entire journal."""
return journal.pprint()
return "\n".join(cls.export_entry(entry) for entry in journal)
@classmethod
def write_file(cls, journal, path):