# No user-serviceable parts below this line
-import os, sys, json, exceptions, getopt, urlparse, time, socket
+import sys, json, exceptions, getopt, urlparse, time, socket
import threading, Queue, SocketServer
import irclib
self.server = None
# Server connection setup
parsed = urlparse.urlparse(url)
- host, sep, port = parsed.netloc.partition(':')
+ host, _, port = parsed.netloc.partition(':')
if not port:
port = 6667
self.servername = host
self.thread = threading.Thread(target=self.dequeue)
self.thread.daemon = True
self.thread.start()
+ self.last_active = None
def enqueue(self, message):
"Enque a message for transmission."
self.queue.put(message)
def close(self, servername, port):
"Release a server instance and all sessions using it."
del self.countmap[(servername, port)]
- for (key, val) in self.sessions:
+ for val in self.sessions.values():
if (val.servername, val.port) == (servername, port):
self.sessions[servername].terminate()
del self.sessions[servername]