irc.py

changeset 76
a2fe9ba3041a
parent 73
d67cc4fbc3f1
child 81
ce5d27463356
equal deleted inserted replaced
75:1818d56c8ff5 76:a2fe9ba3041a
177 if channel.get_value ('name').upper() == channame.upper(): 177 if channel.get_value ('name').upper() == channame.upper():
178 return 178 return
179 179
180 channel = self.cfg.append_nodelist ('channels') 180 channel = self.cfg.append_nodelist ('channels')
181 channel.set_value ('name', channame) 181 channel.set_value ('name', channame)
182 self.channels = cfg.get_nodelist ('channels') 182 self.channels = self.cfg.get_nodelist ('channels')
183 self.write ('JOIN ' + channame) 183 self.write ('JOIN ' + channame)
184 self.save_config() 184 self.cfg.save()
185 185
186 def remove_irc_channel (self, channame): 186 def remove_irc_channel (self, channame):
187 for channel in self.channels: 187 for channel in self.channels:
188 if channel.get_value ('name') == channame: 188 if channel.get_value ('name') == channame:
189 self.channels.remove (channel) 189 self.channels.remove (channel)
190 break 190 break
191 else: 191 else:
192 return 192 return
193 193
194 self.write ('PART ' + channame) 194 self.write ('PART ' + channame)
195 self.save_config() 195 self.cfg.save()
196 196
197 def handle_command (self, sender, ident, host, replyto, command, args, message): 197 def handle_command (self, sender, ident, host, replyto, command, args, message):
198 kvargs = {'sender': sender, 'ident': ident, 'host': host, 'replyto': replyto, 'cmdname': command, 'message': message} 198 kvargs = {'sender': sender, 'ident': ident, 'host': host, 'replyto': replyto, 'cmdname': command, 'message': message}
199 199
200 try: 200 try:

mercurial