mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-04-20 22:05:13 +00:00
check for contents of bookmark files to improve migration
This commit is contained in:
parent
7962da9454
commit
5a60869f8e
2 changed files with 12 additions and 6 deletions
|
|
@ -83,10 +83,11 @@ class Bookmarks(object):
|
|||
def _loadBookmarks(self):
|
||||
for file in self.fileList:
|
||||
try:
|
||||
f = open(file, "r")
|
||||
bookmarks_json = json.load(f)
|
||||
f.close()
|
||||
return [Bookmark(d) for d in bookmarks_json]
|
||||
with open(file, "r") as f:
|
||||
content = f.read()
|
||||
if content:
|
||||
bookmarks_json = json.loads(content)
|
||||
return [Bookmark(d) for d in bookmarks_json]
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except json.JSONDecodeError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue