forked from solderpunk/gemini-demo-1
Wrap long lines.
This commit is contained in:
parent
56f393530f
commit
fea4bc3757
|
@ -6,6 +6,7 @@ import os
|
||||||
import socket
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import textwrap
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
caps = mailcap.getcaps()
|
caps = mailcap.getcaps()
|
||||||
|
@ -56,7 +57,7 @@ while True:
|
||||||
fp = s.makefile("rb")
|
fp = s.makefile("rb")
|
||||||
header = fp.readline()
|
header = fp.readline()
|
||||||
header = header.decode("UTF-8").strip()
|
header = header.decode("UTF-8").strip()
|
||||||
status, mime = header.split("\t")
|
status, mime = header.split()
|
||||||
# Handle input requests
|
# Handle input requests
|
||||||
if status.startswith("1"):
|
if status.startswith("1"):
|
||||||
# Prompt
|
# Prompt
|
||||||
|
@ -94,7 +95,7 @@ while True:
|
||||||
text = bits[1] if len(bits) == 2 else link_url
|
text = bits[1] if len(bits) == 2 else link_url
|
||||||
print("[%d] %s" % (len(menu), text))
|
print("[%d] %s" % (len(menu), text))
|
||||||
else:
|
else:
|
||||||
print(line)
|
print(textwrap.fill(line, 80))
|
||||||
# Handle any other plain text
|
# Handle any other plain text
|
||||||
else:
|
else:
|
||||||
print(body)
|
print(body)
|
||||||
|
|
Loading…
Reference in New Issue