ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/TWikiIB/makeDepMetrics.py
(Generate patch)

Comparing UserCode/TWikiIB/makeDepMetrics.py (file contents):
Revision 1.3 by geonmo, Mon Sep 7 22:58:39 2009 UTC vs.
Revision 1.10 by geonmo, Tue Sep 8 10:04:03 2009 UTC

# Line 16 | Line 16 | class mkDepMetrics(object) :
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 >                    self.page.write('</div>\n')
29 >                    self.page.write('''<br><pre>
30 > * CCD:  Cumulative Component Dependency measures the cumulative testing cost
31 >        across the system.
32 > * ACD:  Average Component Dependency indicates the number of other packages
33 >        an average package depends on.
34 > * NCCD: Normalised Cumulative Component Dependency measures how the structure
35 >        differs from a balanced binary tree of comparable size. If NCCD is one,
36 >        the structure resembles a binary tree; if much less than one, the
37 >        packages are mostly independent; if much greater than one, the system
38 >        is fairly strongly coupled. The only universal NCCD target is to
39 >        minimise for any given software system--a high value indicates a
40 >        strongly coupled system and less coupling is better.
41 > </pre>
42 > ''')
43 >                    break
44 >                elif line=='\n' :
45                      continue
46 <                if writeflag :
46 >                elif line[0:5] =='* CCD' :
47 >                    writeflag = False
48 >                elif line=='# Cycles\n' :
49 >                    self.page.write('         * Cycles\n\n')
50 >                    self.page.write('<div id="test">\n')
51 >                    cycleflag=True
52 >                elif matchCycle and cycleflag :
53 >                    self.page.write('   * '+matchCycle.group(1)+'\n')
54 >                elif cycleflag :
55 >                    self.page.write('      * !'+line.strip()+'\n')
56 >                elif writeflag :
57                      self.page.write('         * '+line)
58 +                else :
59 +                    continue
60                  
61  
62          def packlist(self):
# Line 43 | Line 71 | class mkDepMetrics(object) :
71              for line in contents :
72                  if line =='# Levels\n' :
73                      writeflag = True
46                    print line
74                      continue
75                  elif not writeflag :
76                      continue
# Line 62 | Line 89 | class mkDepMetrics(object) :
89                          continue
90                      else :
91                          temp =line.strip()
65                        print temp
92                          pack[j].append(temp)
93              return pack
94   # repack return list [[levels], [level1, [PACKEGE1,module1,module2,...], [PACKEGE2,module1,module2], ..],[level2,[],[],...] ...]
95          def repack(self,pack):
70            #print pack
96              listlen = len(pack)
97              pack2 = [['Levels']]
98              countpack = 0
# Line 85 | Line 110 | class mkDepMetrics(object) :
110                          temp.append(title)
111                          packname.append(temp)
112                          packname[check].append(module)
88                        #print packname[0]
113                      else:
114                          if packname[check][0]==title:
91                            #print 'it\'s work!'
115                              packname[check].append(module)
116                          else:
117                              check = check + 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines