97 self.commandprefix = Config.get_value ('commandprefix', default='.') |
99 self.commandprefix = Config.get_value ('commandprefix', default='.') |
98 all_clients.append (self) |
100 all_clients.append (self) |
99 asyncore.dispatcher.__init__ (self) |
101 asyncore.dispatcher.__init__ (self) |
100 self.create_socket (socket.AF_INET, socket.SOCK_STREAM) |
102 self.create_socket (socket.AF_INET, socket.SOCK_STREAM) |
101 self.connect ((self.host, self.port)) |
103 self.connect ((self.host, self.port)) |
|
104 ClientsByName[self.name] = self |
102 |
105 |
103 def register_to_irc (self): |
106 def register_to_irc (self): |
104 ident = Config.get_value ('ident', default='cobalt') |
107 ident = Config.get_value ('ident', default='cobalt') |
105 gecos = Config.get_value ('gecos', default='cobalt') |
108 gecos = Config.get_value ('gecos', default='cobalt') |
106 self.write ("PASS %s" % self.password) |
109 self.write ("PASS %s" % self.password) |
133 def send_all_now (self): |
136 def send_all_now (self): |
134 for line in self.send_buffer: |
137 for line in self.send_buffer: |
135 if self.verbose: |
138 if self.verbose: |
136 print "[%s] <- %s" % (self.name, line) |
139 print "[%s] <- %s" % (self.name, line) |
137 self.send ("%s\n" % line) |
140 self.send ("%s\n" % line) |
|
141 time.sleep (0.25) |
138 self.send_buffer = [] |
142 self.send_buffer = [] |
139 |
143 |
140 def handle_read (self): |
144 def handle_read (self): |
141 lines = self.recv (4096).splitlines() |
145 lines = self.recv (4096).splitlines() |
142 for utfline in lines: |
146 for utfline in lines: |