Mercurial > xib
comparison irclib.py @ 231:5f1e9211af03
fix for 48ad162772b79740e8ff580bde2c250b9957c126, we do need arguments in nick callbacks
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 07 Mar 2010 23:03:18 +0100 |
parents | 8e6a0b60eed1 |
children | c9c0d9a5e0b8 |
comparison
equal
deleted
inserted
replaced
230:d5a126cf119c | 231:5f1e9211af03 |
---|---|
603 | 603 |
604 self.lock.release() | 604 self.lock.release() |
605 return self | 605 return self |
606 | 606 |
607 | 607 |
608 def _call_nick_callbacks(self, error): | 608 def _call_nick_callbacks(self, error, arguments=[]): |
609 if len(self.nick_callbacks) == 0: | 609 if len(self.nick_callbacks) == 0: |
610 self.irclibobj.bot.error(1, 'no nick callback for "'+self.__str__()+'"', debug=True) | 610 self.irclibobj.bot.error(1, 'no nick callback for "'+self.__str__()+'"', debug=True) |
611 else: | 611 else: |
612 self.irclibobj.bot.error(1, 'calling '+str(len(self.nick_callbacks))+' nick callback(s) for "'+self.__str__()+'"', debug=True) | 612 self.irclibobj.bot.error(1, 'calling '+str(len(self.nick_callbacks))+' nick callback(s) for "'+self.__str__()+'"', debug=True) |
613 for f in self.nick_callbacks: | 613 for f in self.nick_callbacks: |
614 f(error) | 614 f(error, arguments=arguments) |
615 self.nick_callbacks = [] | 615 self.nick_callbacks = [] |
616 | 616 |
617 | 617 |
618 def _call_join_callbacks(self, channel, error): | 618 def _call_join_callbacks(self, channel, error): |
619 self.lock.acquire() | 619 self.lock.acquire() |
817 | 817 |
818 def _handle_event(self, event): | 818 def _handle_event(self, event): |
819 """[Internal]""" | 819 """[Internal]""" |
820 self.irclibobj._handle_event(self, event) | 820 self.irclibobj._handle_event(self, event) |
821 if event.eventtype() in ['disconnect', 'nicknameinuse', 'nickcollision', 'erroneusnickname', 'nicknametoolong']: | 821 if event.eventtype() in ['disconnect', 'nicknameinuse', 'nickcollision', 'erroneusnickname', 'nicknametoolong']: |
822 self._call_nick_callbacks(event.eventtype()) | 822 self._call_nick_callbacks(event.eventtype(), arguments=[event]) |
823 if event.eventtype() in self.handlers: | 823 if event.eventtype() in self.handlers: |
824 for fn in self.handlers[event.eventtype()]: | 824 for fn in self.handlers[event.eventtype()]: |
825 fn(self, event) | 825 fn(self, event) |
826 | 826 |
827 def is_connected(self): | 827 def is_connected(self): |