]>
jfr.im git - irc/rizon/acid.git/blob - pyva/src/main/python/trivia/cmd_admin.py
1 import pseudoclient
.sys_base
3 from datetime
import datetime
6 #---------------------------------------------------------------------#
7 # import admin cmds and re-export commands we don't need to override
9 from pseudoclient
import cmd_admin
10 from pseudoclient
.cmd_admin
import \
18 #---------------------------------------------------------------------#
20 def admin_sys(self
, source
, target
, pieces
):
30 names
.append('options')
31 subsystems
.append(self
.options
)
34 names
.append('channels')
35 subsystems
.append(self
.channels
)
39 subsystems
.append(self
.auth
)
44 if operation
in ['u', 'update']:
45 for subsystem
in subsystems
:
48 self
.msg(target
, 'Forced update for @b%s@b.' % '@b, @b'.join(names
))
49 elif operation
in ['r', 'reload']:
50 for subsystem
in subsystems
:
53 self
.msg(target
, 'Forced reload for @b%s@b.' % '@b, @b'.join(names
))
59 def admin_stats(self
, source
, target
, pieces
):
60 self
.msg(target
, 'Registered channels: @b%d@b.' % len(self
.channels
.list_all()))
63 def admin_qsize(self
, source
, target
, pieces
):
64 self
.msg(target
, 'Queue size: %d' % len(self
.limit_monitor
))
69 'chan' : (admin_chan
, '<ban|unban|info|add|remove|list|blist> <channel> [reason]'),
70 'unreg' : (admin_unregistered
, '<check|list|part> - remove unregistered channels'),
71 'stats' : (admin_stats
, 'counts registered channels'),
72 'db' : (admin_db
, '[on|off] - enables/disables auto commits to db'),
73 'opt' : (admin_opt
, '[get|set|clear] [option] [value] - manipulates options (list all if no arguments)'),
74 'sys' : (admin_sys
, '<subsystem> <operation> [value] - (subsystems: options (o), channels (c), auth (a)) (operations: update (u), reload (r))'),
75 'log' : (admin_log
, '[level] - gets or sets the log level (0-7).'),
76 'msg' : (admin_msg
, '<message> - sends a message to all channels'),
77 'qsize' : (admin_qsize
, '[debug command] shows channel update queue size'),