def dotest(testnr): exs = examples.getexamples() random.shuffle(exs) teller = 0 for i in exs: no = 0 for zz in donot: if i.find(zz) != -1: no = 1 break if no: continue teller += 1 try: ievent = Ircevent() ievent.nick = 'test' ievent.userhost = 'test@test' q = Queue.Queue() ievent.queues.append(q) ievent.channel = '#dunkbots' ievent.txt = i queues.append((testnr, teller, i, q)) if not plugins.trydispatch(bot, ievent): print "\ncan't execute %s\n" % i queues.remove((testnr, teller, i, q)) except: handle_exception()
def dodcctest(name, insocket, nrloop): a = examples.getexamples() teller = 0 while 1: nrloop -= 1 if nrloop == 0: break random.shuffle(a) for z in a: teller += 1 no = 0 for zz in donot: if z.find(zz) != -1: no = 1 break if no: continue rlog(100, '%s %s-%s' % (name, nrloop, teller), 'sending ' \ + str(z)) insocket.send('!' + str(z) + ' chan ' + channel + '\n') teller = 0
def dowebtest(nrloop): a = examples.getexamples() teller = 0 while 1: nrloop -= 1 if nrloop == 0: break random.shuffle(a) for z in a: teller += 1 no = 0 for zz in donot: if z.find(zz) != -1: no = 1 break print z try: print geturl('http://localhost:8088/dispatch?command=%s' % z) except IOError: pass except: os._exit(0)
if msg.rest: match = msg.rest else: match = "" try: users.add('test', ['test@test',], ['USER', 'OPER']) except Exception, ex: pass bot.channels.setdefault('test', {}) try: loop = int(msg.options['--loop']) except (KeyError, ValueError): loop = 1 for i in range(loop): msg.reply('starting loop %s' % str(i)) examplez = examples.getexamples() random.shuffle(examplez) for example in examplez: if match and match not in example: continue skip = False for dont in donot: if dont in example: skip = True if skip: continue if bot.jabber: from gozerbot.jabber.jabbermsg import Jabbermsg newmessage = Jabbermsg(msg.orig) newmessage.copyin(msg) newmessage.txt = '!' + example
else: match = "" try: users.add('test', [ 'test@test', ], ['USER', 'OPER']) except Exception, ex: pass bot.channels.setdefault('test', {}) try: loop = int(msg.options['--loop']) except (KeyError, ValueError): loop = 1 for i in range(loop): msg.reply('starting loop %s' % str(i)) examplez = examples.getexamples() random.shuffle(examplez) for example in examplez: if match and match not in example: continue skip = False for dont in donot: if dont in example: skip = True if skip: continue if bot.jabber: from gozerbot.jabber.jabbermsg import Jabbermsg newmessage = Jabbermsg(msg.orig) newmessage.copyin(msg) newmessage.txt = '!' + example