From aae0fc21b62648f0d8131b9acbbdf8f5f1aeb625 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Sun, 5 Apr 2015 03:26:52 +0400 Subject: [PATCH] Export DayOne UUID in json Fixes #333 --- jrnl/plugins/json_exporter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jrnl/plugins/json_exporter.py b/jrnl/plugins/json_exporter.py index 374e4e51..5abaf916 100644 --- a/jrnl/plugins/json_exporter.py +++ b/jrnl/plugins/json_exporter.py @@ -14,13 +14,16 @@ class JSONExporter(TextExporter): @classmethod def entry_to_dict(cls, entry): - return { + entry_dict = { 'title': entry.title, 'body': entry.body, 'date': entry.date.strftime("%Y-%m-%d"), 'time': entry.date.strftime("%H:%M"), 'starred': entry.starred } + if hasattr(entry, "uuid"): + entry_dict['uuid'] = entry.uuid + return entry_dict @classmethod def export_entry(cls, entry):