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