mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-21 05:28:31 +02:00
[JSON Exporter] add support for extended DayOne Metadata
This commit is contained in:
parent
9085b2132b
commit
fe819dcbf4
2 changed files with 22 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -43,6 +43,7 @@ obj
|
||||||
env/
|
env/
|
||||||
env*/
|
env*/
|
||||||
venv*/
|
venv*/
|
||||||
|
.venv*/
|
||||||
|
|
||||||
# PyCharm Project files
|
# PyCharm Project files
|
||||||
.idea/
|
.idea/
|
||||||
|
|
|
@ -23,6 +23,27 @@ class JSONExporter(TextExporter):
|
||||||
}
|
}
|
||||||
if hasattr(entry, "uuid"):
|
if hasattr(entry, "uuid"):
|
||||||
entry_dict["uuid"] = entry.uuid
|
entry_dict["uuid"] = entry.uuid
|
||||||
|
if (
|
||||||
|
hasattr(entry, "creator_device_agent")
|
||||||
|
or hasattr(entry, "creator_generation_date")
|
||||||
|
or hasattr(entry, "creator_host_name")
|
||||||
|
or hasattr(entry, "creator_os_agent")
|
||||||
|
or hasattr(entry, "creator_software_agent")
|
||||||
|
):
|
||||||
|
entry_dict["creator"] = {}
|
||||||
|
if hasattr(entry, "creator_device_agent"):
|
||||||
|
entry_dict["creator"]["device_agent"] = entry.creator_device_agent
|
||||||
|
if hasattr(entry, "creator_generation_date"):
|
||||||
|
entry_dict["creator"]["generation_date"] = str(
|
||||||
|
entry.creator_generation_date
|
||||||
|
)
|
||||||
|
if hasattr(entry, "creator_host_name"):
|
||||||
|
entry_dict["creator"]["host_name"] = entry.creator_host_name
|
||||||
|
if hasattr(entry, "creator_os_agent"):
|
||||||
|
entry_dict["creator"]["os_agent"] = entry.creator_os_agent
|
||||||
|
if hasattr(entry, "creator_software_agent"):
|
||||||
|
entry_dict["creator"]["software_agent"] = entry.creator_software_agent
|
||||||
|
|
||||||
return entry_dict
|
return entry_dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue