Export DayOne UUID in json

Fixes #333
This commit is contained in:
Manuel Ebert 2015-04-05 03:26:52 +04:00
parent c508e0c574
commit aae0fc21b6

View file

@ -14,13 +14,16 @@ class JSONExporter(TextExporter):
@classmethod @classmethod
def entry_to_dict(cls, entry): def entry_to_dict(cls, entry):
return { entry_dict = {
'title': entry.title, 'title': entry.title,
'body': entry.body, 'body': entry.body,
'date': entry.date.strftime("%Y-%m-%d"), 'date': entry.date.strftime("%Y-%m-%d"),
'time': entry.date.strftime("%H:%M"), 'time': entry.date.strftime("%H:%M"),
'starred': entry.starred 'starred': entry.starred
} }
if hasattr(entry, "uuid"):
entry_dict['uuid'] = entry.uuid
return entry_dict
@classmethod @classmethod
def export_entry(cls, entry): def export_entry(cls, entry):