mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Adds the tag symbol to day one entries on load
This commit is contained in:
parent
129595e1c7
commit
c89247ef94
1 changed files with 4 additions and 3 deletions
|
@ -25,6 +25,7 @@ import pytz
|
|||
import uuid
|
||||
import tzlocal
|
||||
|
||||
|
||||
class Journal(object):
|
||||
def __init__(self, name='default', **kwargs):
|
||||
self.config = {
|
||||
|
@ -318,6 +319,7 @@ class Journal(object):
|
|||
entry.modified = not any(entry == old_entry for old_entry in self.entries)
|
||||
self.entries = mod_entries
|
||||
|
||||
|
||||
class DayOne(Journal):
|
||||
"""A special Journal handling DayOne files"""
|
||||
def __init__(self, **kwargs):
|
||||
|
@ -342,7 +344,7 @@ class DayOne(Journal):
|
|||
title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "")
|
||||
entry = Entry.Entry(self, date, title, body, starred=dict_entry["Starred"])
|
||||
entry.uuid = dict_entry["UUID"]
|
||||
entry.tags = dict_entry.get("Tags", [])
|
||||
entry.tags = [self.config['tagsymbols'][0] + tag for tag in dict_entry.get("Tags", [])]
|
||||
self.entries.append(entry)
|
||||
self.sort()
|
||||
|
||||
|
@ -430,4 +432,3 @@ class DayOne(Journal):
|
|||
self._deleted_entries = [e for e in self.entries if e.uuid not in edited_uuids]
|
||||
self.entries[:] = [e for e in self.entries if e.uuid in edited_uuids]
|
||||
return entries
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue