From f6a8f20a07ff9126297cf785a150ac7f134f6006 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Sun, 18 Aug 2019 22:32:34 +0300 Subject: [PATCH] Fix bookmarking. --- av98.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/av98.py b/av98.py index f54aadf..df2521c 100755 --- a/av98.py +++ b/av98.py @@ -860,13 +860,14 @@ Optionally, specify the new name for the bookmark.""" def do_bookmarks(self, *args): """Show the current bookmarks menu. Bookmarks are stored in the ~/.av98-bookmarks.txt file.""" - file_name = "~/.av98-bookmarks.txt" - if not os.path.isfile(os.path.expanduser(file_name)): - print("You need to 'add' some bookmarks, first") + bm_file = os.path.expanduser("~/.av98-bookmarks.txt") + if not os.path.exists(bm_file): + print("You need to 'add' some bookmarks, first!") else: - gi = GeminiItem(None, None, os.path.expanduser(file_name), - file_name) - self._go_to_gi(gi) + with open(bm_file, "r") as fp: + body = fp.read() + gi = GeminiItem("file://localhost/" + bm_file) + self._handle_index(body, gi) ### Help def do_help(self, arg):