mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-12 01:18:31 +02:00
Ignore unreadably DayOne entries
This commit is contained in:
parent
a5d345173a
commit
8604bf8455
1 changed files with 18 additions and 13 deletions
|
@ -24,6 +24,7 @@ import plistlib
|
|||
import pytz
|
||||
import uuid
|
||||
import tzlocal
|
||||
from xml.parsers.expat import ExpatError
|
||||
|
||||
|
||||
class Journal(object):
|
||||
|
@ -332,7 +333,11 @@ class DayOne(Journal):
|
|||
self.entries = []
|
||||
for filename in filenames:
|
||||
with open(filename, 'rb') as plist_entry:
|
||||
try:
|
||||
dict_entry = plistlib.readPlist(plist_entry)
|
||||
except ExpatError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
timezone = pytz.timezone(dict_entry['Time Zone'])
|
||||
except (KeyError, pytz.exceptions.UnknownTimeZoneError):
|
||||
|
|
Loading…
Add table
Reference in a new issue