From 9adfb955d7a922df89572d8e4ed060a1c1a1869d Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Thu, 31 Mar 2022 11:00:55 +0200 Subject: [PATCH] automatically create bookmarks list --- offpunk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/offpunk.py b/offpunk.py index 7820582..b3a67ed 100755 --- a/offpunk.py +++ b/offpunk.py @@ -836,6 +836,7 @@ class GopherRenderer(AbstractRenderer): if not path.startswith("/"): path = "/"+path url = "gopher://%s%s/%s%s" %(host,port,itemtype,path) + url = url.replace(" ","%20") linkline = url + " " + name links.append(linkline) towrap = "[%s] "%len(links)+ name @@ -3450,7 +3451,10 @@ see "handler" command to set your own.""" If no argument given, URL is added to Bookmarks.""" args = line.split() if len(args) < 1 : - self.list_add_line("bookmarks") + list = "bookmarks" + if not self.list_path(list): + self.list_create(list) + self.list_add_line(list) else: self.list_add_line(args[0])