Mercurial > xib
comparison irclib.py @ 165:12d564cd0203
minor fix in irclib, always use exactly the same message when server hung up
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Wed, 20 Jan 2010 10:49:33 +0100 |
parents | 6b91ca42df98 |
children | 0fc24e232997 |
comparison
equal
deleted
inserted
replaced
164:6b91ca42df98 | 165:12d564cd0203 |
---|---|
920 self.socket.send(string.encode('utf-8') + "\r\n") | 920 self.socket.send(string.encode('utf-8') + "\r\n") |
921 if DEBUG: | 921 if DEBUG: |
922 print "TO SERVER:", string | 922 print "TO SERVER:", string |
923 except socket.error, x: | 923 except socket.error, x: |
924 # Ouch! | 924 # Ouch! |
925 self.disconnect("Connection reset by peer.") | 925 self.disconnect("Connection reset by peer") |
926 | 926 |
927 def squit(self, server, comment=""): | 927 def squit(self, server, comment=""): |
928 """Send an SQUIT command.""" | 928 """Send an SQUIT command.""" |
929 self.send_raw("SQUIT %s%s" % (server, comment and (" :" + comment))) | 929 self.send_raw("SQUIT %s%s" % (server, comment and (" :" + comment))) |
930 | 930 |
1140 self.socket.send("\n") | 1140 self.socket.send("\n") |
1141 if DEBUG: | 1141 if DEBUG: |
1142 print "TO PEER: %s\n" % string | 1142 print "TO PEER: %s\n" % string |
1143 except socket.error, x: | 1143 except socket.error, x: |
1144 # Ouch! | 1144 # Ouch! |
1145 self.disconnect("Connection reset by peer.") | 1145 self.disconnect("Connection reset by peer") |
1146 | 1146 |
1147 | 1147 |
1148 class Event: | 1148 class Event: |
1149 """Class representing an IRC event.""" | 1149 """Class representing an IRC event.""" |
1150 def __init__(self, eventtype, source, target, arguments=None): | 1150 def __init__(self, eventtype, source, target, arguments=None): |