More steps towards actual IRC.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 25 Aug 2012 13:48:45 +0000 (09:48 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 25 Aug 2012 13:48:45 +0000 (09:48 -0400)
irker.py

index 5c7c988855e94d09c4426dacd4a1c081e5551166..182dabc88e8e948c2ef818cc6b8804f0d1902457 100755 (executable)
--- 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: