forked from solderpunk/AV-98
introduced default_protocol option which default to gemini, solving #21
This commit is contained in:
parent
b5640cc474
commit
63db80c7be
|
@ -4,6 +4,7 @@
|
||||||
Changes since beta2:
|
Changes since beta2:
|
||||||
- bug #25 : makes python-requests optional again
|
- bug #25 : makes python-requests optional again
|
||||||
- --disable-http had no effect: reimplemented
|
- --disable-http had no effect: reimplemented
|
||||||
|
- introduced the "default_protocol" options (default to gemini) to enter URLs without the :// part (fixes bug #21)
|
||||||
|
|
||||||
## 2.0-beta2 - November 8th 2023
|
## 2.0-beta2 - November 8th 2023
|
||||||
Changes since beta1
|
Changes since beta1
|
||||||
|
|
|
@ -173,6 +173,7 @@ class GeminiClient(cmd.Cmd):
|
||||||
"wikipedia" : "gemini://vault.transjovian.org:1965/search/%s/%s",
|
"wikipedia" : "gemini://vault.transjovian.org:1965/search/%s/%s",
|
||||||
"search" : "gemini://kennedy.gemi.dev/search?%s",
|
"search" : "gemini://kennedy.gemi.dev/search?%s",
|
||||||
"accept_bad_ssl_certificates" : False,
|
"accept_bad_ssl_certificates" : False,
|
||||||
|
"default_protocol" : "gemini",
|
||||||
}
|
}
|
||||||
self.redirects = offblocklist.redirects
|
self.redirects = offblocklist.redirects
|
||||||
for i in offblocklist.blocked:
|
for i in offblocklist.blocked:
|
||||||
|
@ -667,6 +668,9 @@ Use with "cache" to copy the path of the cached content."""
|
||||||
# If this isn't a mark, treat it as a URL
|
# If this isn't a mark, treat it as a URL
|
||||||
elif looks_like_url(line):
|
elif looks_like_url(line):
|
||||||
self._go_to_url(line)
|
self._go_to_url(line)
|
||||||
|
elif "://" not in line and "default_protocol" in self.options.keys()\
|
||||||
|
and looks_like_url(self.options["default_protocol"]+"://"+line):
|
||||||
|
self._go_to_url(self.options["default_protocol"]+"://"+line)
|
||||||
else:
|
else:
|
||||||
print("%s is not a valid URL to go"%line)
|
print("%s is not a valid URL to go"%line)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue