5
__copyright__ = 'this file is in the public domain'
7
from gozerbot.commands import cmnds
8
from gozerbot.examples import examples
9
from gozerbot.users import users
10
from gozerbot.redispatcher import rebefore, reafter
11
from gozerbot.aliases import aliases
12
from gozerbot.callbacks import callbacks
13
from gozerbot.plugins import plugins
14
from gozerbot.fleet import fleet
15
from gozerbot.plughelp import plughelp
17
plughelp.add('size', 'the size command shows the sizes of plugins that \
18
provide a size() plugin command and the sizes of some basic structures')
20
def handle_size(bot, ievent):
21
""" size .. show size of core datastructures """
23
txtlist.append("fleet: %s" % fleet.size())
24
txtlist.append("users: %s" % users.size())
25
txtlist.append("cmnds: %s" % cmnds.size())
26
txtlist.append("callbacks: %s" % callbacks.size())
27
txtlist.append("rebefore: %s" % rebefore.size())
28
txtlist.append("reafter: %s" % reafter.size())
29
txtlist.append("aliases: %s" % len(aliases.data))
30
txtlist.append("examples: %s" % examples.size())
31
plugsizes = plugins.plugsizes()
36
cmnds.add('size', handle_size, ['USER', 'WEB', 'ANON'])
37
examples.add('size', 'show sizes of various data structures', 'size')