Tried to add bug detection.
This commit is contained in:
parent
2de7d495d3
commit
2d11e3ad35
@ -170,10 +170,13 @@ class Bot(object):
|
|||||||
# them to the console. This function will be run in a thread, see below.
|
# them to the console. This function will be run in a thread, see below.
|
||||||
def msg_handler(self): # pragma: no cover (this excludes this function from testing)
|
def msg_handler(self): # pragma: no cover (this excludes this function from testing)
|
||||||
new_msg = self.ircsock.recv(2048) # receive data from the server
|
new_msg = self.ircsock.recv(2048) # receive data from the server
|
||||||
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
|
if not new_msg:
|
||||||
|
print "Empty recv."
|
||||||
if new_msg != '' and new_msg.find("PING :") == -1:
|
new_msg=''
|
||||||
print(datetime.datetime.now().isoformat() + " " + new_msg)
|
else:
|
||||||
|
new_msg = new_msg.strip('\n\r') # removing any unnecessary linebreaks
|
||||||
|
if new_msg != '' and new_msg.find("PING :") == -1:
|
||||||
|
print(datetime.datetime.now().isoformat() + " " + new_msg)
|
||||||
return new_msg
|
return new_msg
|
||||||
|
|
||||||
# Checks for messages.
|
# Checks for messages.
|
||||||
|
Loading…
Reference in New Issue
Block a user