changeset 129:b13ca9cefe1c

tried to fix the halt command (added Bot.stop()) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Fri, 15 Jan 2010 16:24:49 +0100
parents e1e66c563d08
children 52d94261a406
files bot.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bot.py
+++ b/bot.py
@@ -919,7 +919,7 @@ class Bot(threading.Thread):
 				self.restart()
 				return
 			elif command == 'halt':
-				self.__del__()
+				self.stop()
 				return
 			
 			
@@ -996,6 +996,10 @@ class Bot(threading.Thread):
 		self.error(error_message, send_to_admins=True)
 	
 	
-	def __del__(self):
+	def stop(self, message='Stopping bot'):
 		for bridge in self.bridges:
-			self.removeBridge(bridge)
+			self.removeBridge(bridge, message=message)
+	
+	
+	def __del__(self):
+		self.stop()