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.12 by geonmo, Wed Sep 9 07:25:22 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 +            if len(contents)==0 :
22 +                self.page.write('      * No data about summary\n')
23              for line in contents :
24 <                print line
21 <                print
24 >                matchCycle = typeCycle.search(line)
25                  if line=='# Summary\n' :
26 +                    self.page.write('      * Summary\n')
27                      writeflag = True
28 <                    continue
25 <                if line=='# Levels\n' :
28 >                elif line=='# Levels\n' :
29                      writeflag = False
30 <                    return
31 <                if line=='\n' :
30 >                    cycleflag = False
31 >                    self.page.write('</div>\n')
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
36 >        an average package depends on.
37 > * NCCD: Normalised Cumulative Component Dependency measures how the structure
38 >        differs from a balanced binary tree of comparable size. If NCCD is one,
39 >        the structure resembles a binary tree; if much less than one, the
40 >        packages are mostly independent; if much greater than one, the system
41 >        is fairly strongly coupled. The only universal NCCD target is to
42 >        minimise for any given software system--a high value indicates a
43 >        strongly coupled system and less coupling is better.
44 > </pre>
45 > ''')
46 >                    break
47 >                elif line=='\n' :
48                      continue
49 <                if writeflag :
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)+'\n')
57 >                elif cycleflag :
58 >                    self.page.write('      * !'+line.strip()+'\n')
59 >                elif writeflag :
60                      self.page.write('         * '+line)
61 +                else :
62 +                    continue
63                  
64  
65          def packlist(self):
# Line 38 | Line 69 | class mkDepMetrics(object) :
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
46                    print line
77                      continue
78                  elif not writeflag :
79                      continue
# Line 62 | Line 92 | class mkDepMetrics(object) :
92                          continue
93                      else :
94                          temp =line.strip()
65                        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):
70            #print pack
99              listlen = len(pack)
100              pack2 = [['Levels']]
101              countpack = 0
# Line 85 | Line 113 | class mkDepMetrics(object) :
113                          temp.append(title)
114                          packname.append(temp)
115                          packname[check].append(module)
88                        #print packname[0]
116                      else:
117                          if packname[check][0]==title:
91                            #print 'it\'s work!'
118                              packname[check].append(module)
119                          else:
120                              check = check + 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines