From: Eric S. Raymond Date: Sat, 25 Aug 2012 13:48:45 +0000 (-0400) Subject: More steps towards actual IRC. X-Git-Tag: 1.0~133 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=87c73ff07d095fdbfe844d571ee17287de7f1c89;p=irker.git More steps towards actual IRC. --- diff --git a/irker.py b/irker.py index 5c7c988..182dabc 100755 --- a/irker.py +++ b/irker.py @@ -41,7 +41,8 @@ class Session(): self.port = 6667 (self.servername, self.channel) = parts[0].split("/", 1) # Client setup - #self.ircserver.connect(self.servername, self.port, "irk"+str(Session.count)) + #self.ircserver.connect(self.servername, self.port, self.name()) + # Also must join the channel. Session.count += 1 def enqueue(self, message): "Enque a message for transmission." @@ -52,11 +53,15 @@ class Session(): message = self.queue.get() self.ship(self.channel, message) self.queue.task_done() + def name(self): + "Generate a unique name for this session." + return "irk" + str(Session.count) def await(self): "Block until processing of the queue is done." self.queue.join() def ship(self, channel, message): "Ship a message to the channel." + # self.ircserver.privmsg(self.name(), message) print "%s: %s" % (channel, message) class Irker: