18 |
|
writeflag = False |
19 |
|
cycleflag = False |
20 |
|
typeCycle = re.compile('^(Cycle \w*)') |
21 |
+ |
if len(contents)==0 : |
22 |
+ |
self.page.write(' * No data about summary\n') |
23 |
|
for line in contents : |
24 |
|
matchCycle = typeCycle.search(line) |
25 |
|
if line=='# Summary\n' : |
26 |
+ |
self.page.write(' * Summary\n') |
27 |
|
writeflag = True |
28 |
|
elif line=='# Levels\n' : |
29 |
|
writeflag = False |
30 |
|
cycleflag = False |
31 |
|
self.page.write('</div>\n') |
32 |
< |
break |
30 |
< |
elif line=='\n' : |
31 |
< |
continue |
32 |
< |
elif line[0:5] =='* CCD' : |
33 |
< |
writeflag = False |
34 |
< |
self.page.write('''<pre> |
32 |
> |
self.page.write('''<br><pre> |
33 |
|
* CCD: Cumulative Component Dependency measures the cumulative testing cost |
34 |
|
across the system. |
35 |
|
* ACD: Average Component Dependency indicates the number of other packages |
43 |
|
strongly coupled system and less coupling is better. |
44 |
|
</pre> |
45 |
|
''') |
46 |
+ |
break |
47 |
+ |
elif line=='\n' : |
48 |
+ |
continue |
49 |
+ |
elif line[0:5] =='* CCD' : |
50 |
+ |
writeflag = False |
51 |
|
elif line=='# Cycles\n' : |
52 |
|
self.page.write(' * Cycles\n\n') |
53 |
|
self.page.write('<div id="test">\n') |
54 |
|
cycleflag=True |
55 |
|
elif matchCycle and cycleflag : |
56 |
< |
self.page.write(' * '+matchCycle.group(1)) |
56 |
> |
self.page.write(' * '+matchCycle.group(1)+'\n') |
57 |
|
elif cycleflag : |
58 |
< |
self.page.write(' * '+line.strip()) |
58 |
> |
self.page.write(' * !'+line.strip()+'\n') |
59 |
|
elif writeflag : |
60 |
|
self.page.write(' * '+line) |
61 |
|
else : |
59 |
– |
print line |
62 |
|
continue |
63 |
|
|
64 |
|
|
69 |
|
writeflag = False |
70 |
|
valueflag = False |
71 |
|
if len(contents)==0 : |
72 |
< |
self.page.write('---+++++No data about metrics information.\n') |
72 |
> |
self.page.write(' * No data about metrics information.\n') |
73 |
|
return pack |
74 |
|
for line in contents : |
75 |
|
if line =='# Levels\n' : |
76 |
|
writeflag = True |
75 |
– |
print line |
77 |
|
continue |
78 |
|
elif not writeflag : |
79 |
|
continue |
92 |
|
continue |
93 |
|
else : |
94 |
|
temp =line.strip() |
94 |
– |
print temp |
95 |
|
pack[j].append(temp) |
96 |
|
return pack |
97 |
|
# repack return list [[levels], [level1, [PACKEGE1,module1,module2,...], [PACKEGE2,module1,module2], ..],[level2,[],[],...] ...] |
98 |
|
def repack(self,pack): |
99 |
– |
#print pack |
99 |
|
listlen = len(pack) |
100 |
|
pack2 = [['Levels']] |
101 |
|
countpack = 0 |
113 |
|
temp.append(title) |
114 |
|
packname.append(temp) |
115 |
|
packname[check].append(module) |
117 |
– |
#print packname[0] |
116 |
|
else: |
117 |
|
if packname[check][0]==title: |
120 |
– |
#print 'it\'s work!' |
118 |
|
packname[check].append(module) |
119 |
|
else: |
120 |
|
check = check + 1 |