From b029f327e4ed0623be40be81c11bdc383151b8ad Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@gmail.com>
Date: Fri, 20 Jun 2008 21:03:38 -0300
Subject: [PATCH 1/7] Remove useless sleep() from msnbot's main loop

Because the select() blocks until a fd is available, there is no need for
the time.sleep(). I think it's just a leftover from older code, wrongly
copied.

Also, remove the unneeded timeout select() parameter, and fix some crappy
whitespace.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
---
 utils/msnbot |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/utils/msnbot b/utils/msnbot
index 001d2d1..cd20735 100755
--- a/utils/msnbot
+++ b/utils/msnbot
@@ -37,11 +37,11 @@ def do_work():
 	Here you do your stuff and send messages using m.sendmsg()
 	This is the only place your code lives
 	"""
-	
+
 	# wait a bit for everything to settle down (sync taking efect
 	# basically)
 	time.sleep(15)
-	
+
 	print '-' * 20 + 'SEND 1'
 	print m.sendmsg("xx@me.com", "Message One")
 
@@ -53,7 +53,7 @@ def do_work():
 
 	# and then quit
 	quit()
-	
+
 
 # you shouldn't need to touch anything past here
 
@@ -104,10 +104,10 @@ while 1:
 
 	# we select, waiting for events
 	try:
-		fds = select.select(infd, outfd, [], 0)
+		fds = select.select(infd, outfd, [])
 	except:
 		quit()
-	
+
 	for i in fds[0] + fds[1]:       # see msnlib.msnd.pollable.__doc__
 		try:
 			m.read(i)
@@ -120,8 +120,5 @@ while 1:
 				# main socket closed
 				quit()
 
-	# sleep a bit so we don't take over the cpu
-	time.sleep(0.01)
-
 
 
-- 
1.6.2.2.646.gb214

