From 6c017f3b9603c4f6a0552a9f9a3c7a018c3d1010 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Mon, 3 Feb 2020 21:34:17 +0100 Subject: [PATCH] Wrap long lines. --- av98.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/av98.py b/av98.py index 7a54aee..2a3d4d9 100755 --- 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