mod_admin.py

changeset 121
ac07779f788d
parent 103
e4891ab34fb1
child 146
c17b82b1f573
equal deleted inserted replaced
120:9880bb697149 121:ac07779f788d
1 from modulecore import command_error 1 from modulecore import command_error
2 import hgapi 2 import sys
3 3
4 ModuleData = { 4 ModuleData = {
5 'commands': 5 'commands':
6 [ 6 [
7 { 7 {
29 'name': 'die', 29 'name': 'die',
30 'description': 'Shuts the bot down', 30 'description': 'Shuts the bot down',
31 'args': None, 31 'args': None,
32 'level': 'admin', 32 'level': 'admin',
33 }, 33 },
34
35 {
36 'name': 'modreload',
37 'description': 'Reloads a module',
38 'args': '<module>',
39 'level': 'admin',
40 },
34 ] 41 ]
35 } 42 }
36 43
37 def cmd_raw (bot, args, **rest): 44 def cmd_raw (bot, args, **rest):
38 bot.write (args['message']) 45 bot.write (args['message'])
43 def cmd_restart (bot, **rest): 50 def cmd_restart (bot, **rest):
44 bot.restart() 51 bot.restart()
45 52
46 def cmd_die (bot, **rest): 53 def cmd_die (bot, **rest):
47 quit() 54 quit()
55
56 def cmd_modreload (bot, args, **rest):
57 reload (sys.modules[args['module']])

mercurial