Pulito un po' il codice.
Leonardo [2010-05-24 14:31]
diff --git a/pywhois.py b/pywhois.py
index 8914e47..053f57e 100644
--- a/pywhois.py
+++ b/pywhois.py
@@ -309,16 +309,22 @@ class WhoisHTTPRequestHandler(BaseHTTPRequestHandler):
"""
Format the raw output of the whois server
"""
+
+ # Sostituiamo le cose con i tag relativi
+ string = re.sub(r"\n", "<br />\n", string)
+
+ # Creiamo effettivamente la pagina
html = "<html>\n"
html += "<head>\n<title>Whois answer for %s</title>\n" % request
html += "</head>\n"
html += self.style_block
html += "<body>\n"
html += "<h1>Whois answer for %s</h1>\n<p>" % request
- html += re.sub(r"\n", "<br>\n", string)
+ html += string
html += self.request_form
html += "</p></body>\n"
html += "</html>"
+
return html
def do_GET(self):