# return an events list based on the .ok, .problem, and .ignore files in a folder. resourceURI= getParam( 'resourceURI', 'file:///home/jbf/pngwalk/product.pngwalk', 'pngwalk file' ) # read the .pngwalk file to get the template template= 'product_$Y$m$d.png' i= resourceURI.rindex('/') base= resourceURI[0:i]+'/' result= None okayFiles= listDirectory(base+'*.ok') tp= TimeParser.create(template+'.ok') for ok1 in okayFiles: tr= tp.parse(ok1).getTimeRange() result= createEvent(result,tr,0x00FF00,'ok') files= listDirectory(base+'*.problem') tp= TimeParser.create(template+'.problem') for f in files: tr= tp.parse(f).getTimeRange() result= createEvent(result,tr,0xFF0000,'problem') files= listDirectory(base+'*.ignore') tp= TimeParser.create(template+'.ignore') for f in files: tr=tp.parse(f).getTimeRange() result= createEvent(result,tr,0xA0A0A0,'ignore')