From 9dac3040b2f18cae49a23bd91bf1fc048d7455c9 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 25 Aug 2013 11:52:41 +0000 Subject: [PATCH] Glob2Chan: Switch to Python 3. --- Glob2Chan/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Glob2Chan/plugin.py b/Glob2Chan/plugin.py index 12cf822..0d2f2b5 100644 --- a/Glob2Chan/plugin.py +++ b/Glob2Chan/plugin.py @@ -52,7 +52,7 @@ class Glob2ChanCallback(httpserver.SupyHTTPServerCallback): index and try out other plugins (if any).""" def doGet(self, handler, path): host = handler.address_string() - if host == 'localhost': + if host in ('localhost', '127.0.0.1', '::1'): assert path.startswith('/status/') status = path[len('/status/'):].replace('/', ' ') self.plugin._announce(ircutils.bold('[YOG]') + @@ -60,12 +60,12 @@ class Glob2ChanCallback(httpserver.SupyHTTPServerCallback): self.send_response(200) self.send_header('Content-type', 'text/plain') self.end_headers() - self.wfile.write('Channel notified.') + self.wfile.write(b'Channel notified.') else: self.send_response(403) self.send_header('Content-type', 'text/plain') self.end_headers() - self.wfile.write('Not authorized.') + self.wfile.write(b'Not authorized.') instance = None