mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-21 05:28:31 +02:00
Allow editing of DayOne entries
This commit is contained in:
parent
6f7c538cb1
commit
07bacabe8d
2 changed files with 15 additions and 2 deletions
|
@ -222,7 +222,6 @@ class DayOne(Journal.Journal):
|
||||||
|
|
||||||
# Now, update our current entries if they changed
|
# Now, update our current entries if they changed
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
entry._parse_text()
|
|
||||||
matched_entries = [
|
matched_entries = [
|
||||||
e for e in self.entries if e.uuid.lower() == entry.uuid.lower()
|
e for e in self.entries if e.uuid.lower() == entry.uuid.lower()
|
||||||
]
|
]
|
||||||
|
|
|
@ -13,7 +13,9 @@ class Entry:
|
||||||
self.journal = journal # Reference to journal mainly to access its config
|
self.journal = journal # Reference to journal mainly to access its config
|
||||||
self.date = date or datetime.now()
|
self.date = date or datetime.now()
|
||||||
self.text = text
|
self.text = text
|
||||||
self._title = self._body = self._tags = None
|
self._title = None
|
||||||
|
self._body = None
|
||||||
|
self._tags = None
|
||||||
self.starred = starred
|
self.starred = starred
|
||||||
self.modified = False
|
self.modified = False
|
||||||
|
|
||||||
|
@ -37,18 +39,30 @@ class Entry:
|
||||||
self._parse_text()
|
self._parse_text()
|
||||||
return self._title
|
return self._title
|
||||||
|
|
||||||
|
@title.setter
|
||||||
|
def title(self, x):
|
||||||
|
self._title = x
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def body(self):
|
def body(self):
|
||||||
if self._body is None:
|
if self._body is None:
|
||||||
self._parse_text()
|
self._parse_text()
|
||||||
return self._body
|
return self._body
|
||||||
|
|
||||||
|
@body.setter
|
||||||
|
def body(self, x):
|
||||||
|
self._body = x
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tags(self):
|
def tags(self):
|
||||||
if self._tags is None:
|
if self._tags is None:
|
||||||
self._parse_text()
|
self._parse_text()
|
||||||
return self._tags
|
return self._tags
|
||||||
|
|
||||||
|
@tags.setter
|
||||||
|
def tags(self, x):
|
||||||
|
self._tags = x
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tag_regex(tagsymbols):
|
def tag_regex(tagsymbols):
|
||||||
pattern = fr"(?<!\S)([{tagsymbols}][-+*#/\w]+)"
|
pattern = fr"(?<!\S)([{tagsymbols}][-+*#/\w]+)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue