
success = None

def successCounters(p):
    return p.get('result') is None and p.get('wrong') == 0 and p.get('exceptions') == 0

if events:
    success = True
    for ev in events:
        if ev.type == 'functionalResult':
            p = ev.getProperties()
            print 'looking at functionalResult event with these props:', p
            if not (successCounters(p) or (p.get('result') == 'PASSED')):
                success = False
                break

resultHolder.setResult(success)