count number of items in result queue.
no arguments - show nr of elements in result list .. use this command in a pipeline.
# fbf/plugs/core/count.py # # """ count number of items in result queue. """
from fbf.lib.commands import cmnds from fbf.utils.generic import waitforqueue from fbf.lib.examples import examples
import time
def handle_count(bot, ievent): """ no arguments - show nr of elements in result list .. use this command in a pipeline. """ #if ievent.prev: ievent.prev.wait() a = ievent.inqueue size = len(a) ievent.reply(str(size)) cmnds.add('count', handle_count, ['OPER', 'USER', 'GUEST']) examples.add('count', 'count nr of items', 'list ! count')