Mercurial > xib
comparison irclib.py @ 63:71508f22edb4
Fixed unjustified switching to limited mode
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 29 Aug 2009 21:57:49 +0200 |
parents | ebd4278e472f |
children | 8fc496eaa17b |
comparison
equal
deleted
inserted
replaced
62:61491895c607 | 63:71508f22edb4 |
---|---|
492 | 492 |
493 def add_nick_callback(self, callback): | 493 def add_nick_callback(self, callback): |
494 self.nick_callbacks.append(callback) | 494 self.nick_callbacks.append(callback) |
495 | 495 |
496 | 496 |
497 def close(self, message): | 497 def close(self, message, volontary=False): |
498 """Close the connection. | 498 """Close the connection. |
499 | 499 |
500 This method closes the connection permanently; after it has | 500 This method closes the connection permanently; after it has |
501 been called, the object is unusable. | 501 been called, the object is unusable. |
502 """ | 502 """ |
503 | 503 |
504 self.disconnect(message) | 504 self.disconnect(message, volontary) |
505 self.irclibobj._remove_connection(self) | 505 self.irclibobj._remove_connection(self) |
506 | 506 |
507 def _get_socket(self): | 507 def _get_socket(self): |
508 """[Internal]""" | 508 """[Internal]""" |
509 return self.socket | 509 return self.socket |
688 | 688 |
689 def ctcp_reply(self, target, parameter): | 689 def ctcp_reply(self, target, parameter): |
690 """Send a CTCP REPLY command.""" | 690 """Send a CTCP REPLY command.""" |
691 self.notice(target, "\001%s\001" % parameter) | 691 self.notice(target, "\001%s\001" % parameter) |
692 | 692 |
693 def disconnect(self, message=""): | 693 def disconnect(self, message="", volontary=False): |
694 """Hang up the connection. | 694 """Hang up the connection. |
695 | 695 |
696 Arguments: | 696 Arguments: |
697 | 697 |
698 message -- Quit message. | 698 message -- Quit message. |
710 self.socket.close() | 710 self.socket.close() |
711 except socket.error, x: | 711 except socket.error, x: |
712 pass | 712 pass |
713 self.socket = None | 713 self.socket = None |
714 self.lock.release() | 714 self.lock.release() |
715 self._handle_event(Event("disconnect", self.server, "", [message])) | 715 |
716 if volontary == False: | |
717 self._handle_event(Event("disconnect", self.server, "", [message])) | |
716 | 718 |
717 def globops(self, text): | 719 def globops(self, text): |
718 """Send a GLOBOPS command.""" | 720 """Send a GLOBOPS command.""" |
719 self.send_raw("GLOBOPS :" + text) | 721 self.send_raw("GLOBOPS :" + text) |
720 | 722 |