if path[-1] != '/': path += '/' results['LOC'] = {} results['NOI'] = {} results['NOX'] = {} for x in names: for y in x: results[y] = {} for z in targets.keys(): results[y][z] = 0 for x in targets.keys(): results['LOC'][x] = 0 results['NOI'][x] = 0 results['NOX'][x] = 0 for y in targets[x]: results['LOC'][x] += slpsXPath.loc(path+y+'.exbgf') results['NOI'][x] += slpsXPath.noi(path+y+'.exbgf') xbgf = ET.parse(path+y+'.exbgf') results['NOX'][x] += len(xbgf.findall('/*')) for z in names: for q in z: # print q qr = q.replace('exbgf:',slpsns.exbgf_('')) # qr = '*' results[q][x] += len(xbgf.findall(qr)) # for w in xbgf.findall(qr) # print slpsns.exbgf_('*')+'/'+qr results[q][x] += len(xbgf.findall('*/'+qr)) # print slpsns.exbgf_('*')+'/'+slpsns.exbgf_('*')+'/'+qr results[q][x] += len(xbgf.findall('*/*/'+qr)) # results[q][x] += len(xbgf.findall(q.replace('xbgf:',slpsns.xbgf_(''))))
if path[-1] != '/': path += '/' results['LOC'] = {} results['NOI'] = {} results['NOX'] = {} for x in names: for y in x: results[y] = {} for z in targets.keys(): results[y][z] = 0 for x in targets.keys(): results['LOC'][x] = 0 results['NOI'][x] = 0 results['NOX'][x] = 0 for y in targets[x]: results['LOC'][x] += slpsXPath.loc(path + y + '.xbgf') results['NOI'][x] += slpsXPath.noi(path + y + '.xbgf') xbgf = ET.parse(path + y + '.xbgf') results['NOX'][x] += len(xbgf.findall('/*')) for z in names: for q in z: results[q][x] += len( xbgf.findall(q.replace('xbgf:', slpsns.xbgf_('')))) for x in names: for y in x: used = False for z in targets.keys(): if results[y][z]: used = True if not used: print '%%', y, 'not used in any XBGF script'
path = sys.argv[3] if path[-1] != '/': path += '/' for x in slpsXPath.rkeys: results[x] = {} for x in names: results[x] = {} for y in targets.keys(): results[x][y] = 0 for x in targets.keys(): for y in slpsXPath.rkeys: results[y][x] = 0 for y in targets[x]: xbgfFile = path+y+'.xbgf' xbgf = ET.parse(xbgfFile) results['LOC'][x] += slpsXPath.loc(xbgfFile) results['NOI'][x] += slpsXPath.nosi(xbgfFile,'ISSUE') results['NI~'][x] += slpsXPath.nosi(xbgfFile,'ISSUE REFACTOR') results['NI+'][x] += slpsXPath.nosi(xbgfFile,'EXTEND') results['NI!'][x] += slpsXPath.nosi(xbgfFile,'CORRECT') results['NI^'][x] += slpsXPath.nosi(xbgfFile,'PERMISSIVENESS') results['COR'][x] += slpsXPath.nosi(xbgfFile,'EXTRACTERROR') results['SGO'][x] += slpsXPath.countSemanticPreserving(xbgf,xbgfFile) results['SID'][x] += slpsXPath.countSemanticIncDec(xbgf,xbgfFile) results['SRE'][x] += slpsXPath.countSemanticRevising(xbgf,xbgfFile) results['NOX'][x] += slpsXPath.notr(xbgf) results['EKB'][x] += slpsXPath.nosi(xbgfFile,'KNOWNBUG') results['EPX'][x] += slpsXPath.nosi(xbgfFile,'POSTEXTR') results['EIC'][x] += slpsXPath.nosi(xbgfFile,'INITCORR') results['EAR'][x] += slpsXPath.nosi(xbgfFile,'KNOWNBUG')+slpsXPath.nosi(xbgfFile,'POSTEXTR')+slpsXPath.nosi(xbgfFile,'INITCORR') results['FEX'][x] += slpsXPath.nosi(xbgfFile,'EXTENSION')