Allow editing of DayOne entries

This commit is contained in:
MinchinWeb 2020-07-02 21:42:55 -06:00
parent 6f7c538cb1
commit 07bacabe8d
2 changed files with 15 additions and 2 deletions

View file

@ -222,7 +222,6 @@ class DayOne(Journal.Journal):
# Now, update our current entries if they changed
for entry in entries:
entry._parse_text()
matched_entries = [
e for e in self.entries if e.uuid.lower() == entry.uuid.lower()
]

View file

@ -13,7 +13,9 @@ class Entry:
self.journal = journal # Reference to journal mainly to access its config
self.date = date or datetime.now()
self.text = text
self._title = self._body = self._tags = None
self._title = None
self._body = None
self._tags = None
self.starred = starred
self.modified = False
@ -37,18 +39,30 @@ class Entry:
self._parse_text()
return self._title
@title.setter
def title(self, x):
self._title = x
@property
def body(self):
if self._body is None:
self._parse_text()
return self._body
@body.setter
def body(self, x):
self._body = x
@property
def tags(self):
if self._tags is None:
self._parse_text()
return self._tags
@tags.setter
def tags(self, x):
self._tags = x
@staticmethod
def tag_regex(tagsymbols):
pattern = fr"(?<!\S)([{tagsymbols}][-+*#/\w]+)"