solving a crash when directly entering an unknown gopher address while offline
This commit is contained in:
parent
9a3013fa5c
commit
040f077836
|
@ -5,6 +5,7 @@
|
||||||
- Default width set to 80 as many gopherhole and gemini capsule have it hardcoded
|
- Default width set to 80 as many gopherhole and gemini capsule have it hardcoded
|
||||||
- Streaming URL without valid content-length are now closed after 5Mo of download (thanks to Eoin Carney for reporting the issue)
|
- Streaming URL without valid content-length are now closed after 5Mo of download (thanks to Eoin Carney for reporting the issue)
|
||||||
- Fixed a crash when the cache is already a dir inside a dir.
|
- Fixed a crash when the cache is already a dir inside a dir.
|
||||||
|
- Fixed a crash when manually entering an unknown gopher URL while offline
|
||||||
|
|
||||||
## 1.2 - March 24th 2022
|
## 1.2 - March 24th 2022
|
||||||
Very experimental release:
|
Very experimental release:
|
||||||
|
|
|
@ -672,7 +672,7 @@ class GemtextRenderer(AbstractRenderer):
|
||||||
def get_title(self):
|
def get_title(self):
|
||||||
if self.title:
|
if self.title:
|
||||||
return self.title
|
return self.title
|
||||||
else:
|
elif self.body:
|
||||||
lines = self.body.splitlines()
|
lines = self.body.splitlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith("#"):
|
if line.startswith("#"):
|
||||||
|
@ -689,6 +689,8 @@ class GemtextRenderer(AbstractRenderer):
|
||||||
else:
|
else:
|
||||||
self.title = "Empty Page"
|
self.title = "Empty Page"
|
||||||
return self.title
|
return self.title
|
||||||
|
else:
|
||||||
|
return "Unknown Gopher Page"
|
||||||
|
|
||||||
#render_gemtext
|
#render_gemtext
|
||||||
def render(self,gemtext, width=None,mode=None):
|
def render(self,gemtext, width=None,mode=None):
|
||||||
|
@ -1471,8 +1473,8 @@ class GeminiItem():
|
||||||
f.close()
|
f.close()
|
||||||
return body
|
return body
|
||||||
else:
|
else:
|
||||||
print("ERROR: NO CACHE for %s" %self._cache_path)
|
#print("ERROR: NO CACHE for %s" %self._cache_path)
|
||||||
return error
|
return None
|
||||||
|
|
||||||
# This method is used to load once the list of links in a gi
|
# This method is used to load once the list of links in a gi
|
||||||
# Links can be followed, after a space, by a description/title
|
# Links can be followed, after a space, by a description/title
|
||||||
|
|
Loading…
Reference in New Issue