newLcf = ET.Element(slpsns.lcf_('configuration')) dirName = outdir if dirName[-1]!='/': dirName += '/' lcfName = dirName+lcffile.split('/')[-1] xbgfDir = '/'.join(lcffile.split('/')[:-1]) if xbgfDir[-1]=='/': xbgfDir += 'xbgf/' else: xbgfDir += '/xbgf/' for el in ltree.findall('*'): if el.tag == 'target': newLcf.append(slicing.sliceTarget(xbgfDir,dirName+'xbgf/',el)) elif el.tag == 'testset': pass else: newLcf.append(el) ET.ElementTree(newLcf).write(lcfName) return if __name__ == "__main__": if len(sys.argv) == 3: slpsns.init(ET) apply(main,sys.argv[1:3]) else: print '''XBGF slicing tool Usage:''' print ' ',sys.argv[0],'<input lcf file>','<output directory>' sys.exit(1)
print 'Observed increase in structural mismatches!' if nm + sm > pnm + psm: print 'The number of mismatches went up from', pnm + psm, 'to', nm + sm sys.exit(3) cx += '_' pnm, psm = nm, sm print 'Cleaning up...' s = 'rm -f ' for c in range(1, len(cx)): s += bgfFile + '_' * c + ' ' print s s = 'rm -f ' for c in sliced: s += xbgfDir + c + '.xbgf ' if os.system(s): print 'Error cleaning up sliced XBGFs!' return if __name__ == "__main__": if len(sys.argv) == 6: slpsns.init(ET) apply(main, sys.argv[1:6]) else: print '''This tool takes an XBGF file, slices it and executes stepwise, asserting the decline in mismatches. Usage:''' print ' ', sys.argv[ 0], '<xbgf file>', '<bgf file>', '<transformer>', '<comparator>', '<synch bgf>' sys.exit(1)