Mercurial > xib
comparison commands.py @ 157:ce0eb3e969a7
added a stop-bot command
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Tue, 19 Jan 2010 07:43:26 +0100 |
parents | 63db565438bd |
children | 266a6afb6b79 |
comparison
equal
deleted
inserted
replaced
156:3f299ad4d452 | 157:ce0eb3e969a7 |
---|---|
24 | 24 |
25 from bridge import Bridge | 25 from bridge import Bridge |
26 | 26 |
27 | 27 |
28 commands = ['xmpp-participants', 'irc-participants', 'xmpp-connections', 'irc-connections', 'connections', 'bridges'] | 28 commands = ['xmpp-participants', 'irc-participants', 'xmpp-connections', 'irc-connections', 'connections', 'bridges'] |
29 admin_commands = ['add-bridge', 'add-xmpp-admin', 'change-bridge-mode', 'debug', 'halt', 'remove-bridge', 'restart-bot', 'restart-bridge', 'stop-bridge'] | 29 admin_commands = ['add-bridge', 'add-xmpp-admin', 'change-bridge-mode', 'debug', 'halt', 'remove-bridge', 'restart-bot', 'restart-bridge', 'stop-bot', 'stop-bridge'] |
30 | 30 |
31 def execute(bot, command_line, bot_admin, bridge): | 31 def execute(bot, command_line, bot_admin, bridge): |
32 ret = '' | 32 ret = '' |
33 command = shlex.split(command_line) | 33 command = shlex.split(command_line) |
34 if len(command) > 1: | 34 if len(command) > 1: |
225 def restart_bridge(bot, command, args_array, bot_admin, bridge): | 225 def restart_bridge(bot, command, args_array, bot_admin, bridge): |
226 bridge.restart() | 226 bridge.restart() |
227 return 'Bridge restarted.' | 227 return 'Bridge restarted.' |
228 | 228 |
229 | 229 |
230 def stop_bot(bot, command, args_array, bot_admin, bridge): | |
231 bot.stop() | |
232 return 'Bot stopped.' | |
233 | |
234 | |
230 def stop_bridge(bot, command, args_array, bot_admin, bridge): | 235 def stop_bridge(bot, command, args_array, bot_admin, bridge): |
231 bridge.stop() | 236 bridge.stop() |
232 return 'Bridge stopped.' | 237 return 'Bridge stopped.' |
233 | 238 |
234 | 239 |