commit 6c017f3b9603c4f6a0552a9f9a3c7a018c3d1010
parent c0f4c8eae49a48a28b21b866935f921becba9a91
Author: Solderpunk <solderpunk@sdf.org>
Date: Mon, 3 Feb 2020 21:34:17 +0100
Wrap long lines.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/av98.py b/av98.py
@@ -24,6 +24,7 @@ import socket
import subprocess
import sys
import tempfile
+import textwrap
import urllib.parse
import ssl
import sys
@@ -207,6 +208,7 @@ class GeminiClient(cmd.Cmd):
"ipv6" : True,
"timeout" : 10,
"gopher_proxy" : "localhost:1965",
+ "width" : 80,
"auto_follow_redirects" : True,
}
@@ -486,7 +488,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
except:
self._debug("Skipping possible link: %s" % line)
else:
- tmpf.write(line + "\n")
+ tmpf.write(textwrap.fill(line, self.options["width"]) + "\n")
tmpf.close()
self.lookup = self.index