Mercurial > xib
comparison bot.py @ 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 | db3f648a9e9e |
children | 52d94261a406 |
comparison
equal
deleted
inserted
replaced
128:e1e66c563d08 | 129:b13ca9cefe1c |
---|---|
917 | 917 |
918 elif command == 'restart-bot': | 918 elif command == 'restart-bot': |
919 self.restart() | 919 self.restart() |
920 return | 920 return |
921 elif command == 'halt': | 921 elif command == 'halt': |
922 self.__del__() | 922 self.stop() |
923 return | 923 return |
924 | 924 |
925 | 925 |
926 elif command in ['remove-bridge', 'restart-bridge', 'stop-bridge']: | 926 elif command in ['remove-bridge', 'restart-bridge', 'stop-bridge']: |
927 # we need to know which bridge the command is for | 927 # we need to know which bridge the command is for |
994 b.stop(message=leave_message) | 994 b.stop(message=leave_message) |
995 | 995 |
996 self.error(error_message, send_to_admins=True) | 996 self.error(error_message, send_to_admins=True) |
997 | 997 |
998 | 998 |
999 def stop(self, message='Stopping bot'): | |
1000 for bridge in self.bridges: | |
1001 self.removeBridge(bridge, message=message) | |
1002 | |
1003 | |
999 def __del__(self): | 1004 def __del__(self): |
1000 for bridge in self.bridges: | 1005 self.stop() |
1001 self.removeBridge(bridge) |