donot = ['quit', 'reboot', 'jump']
config.load()
oldlevel = config['loglevel']
config['loglevel'] = 1000
enable_logging()
startmaindb()
cfg = Config()
bot = Bot(cfg)
bot.channels.setdefault('#test', {})
bot.channels.setdefault('#dunkbots', {})
bot.userhosts['dunker'] = '*****@*****.**'
bot.userhosts['test'] = 'test@test'
bot.server = 'localhost'
bot.port = 6667
fleet.addbot(bot)
plugins.regplugins()
time.sleep(5)

try:
    users.add('test', [
        'test@test',
    ], ['OPER', 'USER', 'QUOTE', 'MAIL'])
except Exception, ex:
    pass

try:
    users.setemail('test', '*****@*****.**')
except Exception, ex:
    pass

Exemple #2
0
signal.signal(signal.SIGTERM, stop)
signal.signal(signal.SIGINT, stop)

try:
    users.delete('test')
except:
    pass

users.add('test', ['test@test', ], ['USER', 'OPER', 'ALIAS', 'FORGET', \
'QUOTE'])

bot = Bot('test@test')
bot.channels.data['#dunkbots'] = {}
bot.userhosts['dunker'] = 'test@test'
print "loading plugins"
plugins.regplugins()

queues = []

def qreader():
    while 1:
        time.sleep(0.01)
        for i in queues:
            (testnr, teller, cmnd, q) = i
            try:
                res = q.get(1, 1)
                nr = len(queues)
                print '\n<=%s==%s=> (%s)' % (testnr, teller, nr)
                print "%s => %s" % (cmnd, res)
                queues.remove((testnr, teller, cmnd, q))
            except: