16 |
|
def makeSummary(self): |
17 |
|
contents=self.contents |
18 |
|
writeflag = False |
19 |
+ |
cycleflag = False |
20 |
+ |
typeCycle = re.compile('^(Cycle \w*)') |
21 |
|
for line in contents : |
22 |
< |
print line |
21 |
< |
print |
22 |
> |
matchCycle = typeCycle.search(line) |
23 |
|
if line=='# Summary\n' : |
24 |
|
writeflag = True |
25 |
< |
continue |
25 |
< |
if line=='# Levels\n' : |
25 |
> |
elif line=='# Levels\n' : |
26 |
|
writeflag = False |
27 |
< |
return |
28 |
< |
if line=='\n' : |
27 |
> |
cycleflag = False |
28 |
> |
break |
29 |
> |
elif line=='\n' : |
30 |
|
continue |
31 |
< |
if writeflag : |
31 |
> |
elif line[0:5] =='* CCD' : |
32 |
> |
writeflag = False |
33 |
> |
self.page.write('''<pre> |
34 |
> |
* CCD: Cumulative Component Dependency measures the cumulative testing cost |
35 |
> |
across the system. |
36 |
> |
* ACD: Average Component Dependency indicates the number of other packages |
37 |
> |
an average package depends on. |
38 |
> |
* NCCD: Normalised Cumulative Component Dependency measures how the structure |
39 |
> |
differs from a balanced binary tree of comparable size. If NCCD is one, |
40 |
> |
the structure resembles a binary tree; if much less than one, the |
41 |
> |
packages are mostly independent; if much greater than one, the system |
42 |
> |
is fairly strongly coupled. The only universal NCCD target is to |
43 |
> |
minimise for any given software system--a high value indicates a |
44 |
> |
strongly coupled system and less coupling is better. |
45 |
> |
''' |
46 |
> |
elif line=='# Cycles\n' : |
47 |
> |
self.page.write(' * Cycles\n\n') |
48 |
> |
cycleflag=True |
49 |
> |
elif matchCycle and cycleflag : |
50 |
> |
self.page.write(' * '+matchCycle.group(1)) |
51 |
> |
elif cycleflag : |
52 |
> |
self.page.write(' * '+line.strip()) |
53 |
> |
elif writeflag : |
54 |
|
self.page.write(' * '+line) |
55 |
+ |
else : |
56 |
+ |
print line |
57 |
+ |
continue |
58 |
|
|
59 |
|
|
60 |
|
def packlist(self): |