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.2 by geonmo, Mon Sep 7 14:00:54 2009 UTC vs.
Revision 1.3 by geonmo, Mon Sep 7 22:58:39 2009 UTC

# Line 8 | Line 8 | class mkDepMetrics(object) :
8                  self.arch = arch
9                  self.packagename = packagename
10                  self.url = 'https://macms01.cern.ch/ap/ignominy/'+arch+'/'+packagename+'/igRun/metrics'
11 <                temp = os.popen('wget --no-check-certificate -nv -o /dev/null -O- '+self.url)
11 >                temp = os.popen('wget --no-check-certificate -nv -o /dev/null -O- '+self.url)
12 >                self.contents=[]
13                  self.contents = temp.readlines()
14  
15 <                self.page.write("""
16 < <!--
17 <   * Set MENU_ID = test
18 < -->
19 <
20 < <style> /* <pre> */
21 < %STARTSECTION{"css"}%
22 <
23 < #%MENU_ID% ul{
24 <  margin: 0px;
25 <  pading: 0px;
26 < }
27 <
28 < #%MENU_ID% ul li{
29 <  position:relative;    
30 <  list-style: none;
31 <  margin: 0px 0px 0px 15px;
31 <  float: left;
32 <  font-family: sans-serif;
33 <  font-weight: 800;
34 <  font-size: 12px;
35 < }
36 <
37 < #%MENU_ID% ul ul li{
38 <  position:relative;    
39 <  font-weight: 500;
40 <  float: none;
41 <  margin: 0px 0px 0px -40px;
42 <  pading: 0px;
43 <  border: none;
44 <  background-color: none;
45 <  border-top: 1px solid #F8F8F8;
46 <  border-bottom: 1px solid #C0C0C0;
47 < }
48 < #%MENU_ID%.msie ul ul li{
49 <  position:relative;    
50 <  margin-left: 0px;
51 < }
52 <
53 < #%MENU_ID% ul ul{
54 <  margin: 0px;
55 <  clear: left;
56 <  display: none;
57 <  position: absolute;
58 <  top: 20px;
59 <  left: 0px;
60 <  background-color: #E0E0E0;
61 <  border: 1px solid #808080;
62 <  width: 150px;
63 <  z-index:30;
64 < }
65 < #%MENU_ID%.msie ul ul{
66 <  width: 180px;
67 < }
68 <
69 < #%MENU_ID% ul ul ul{
70 <  top: 5px;
71 <  left: 190px;
72 < }
73 <
74 < #%MENU_ID% a:link,
75 < #%MENU_ID% a:active,
76 < #%MENU_ID% a:visited{
77 <  text-decoration: none;
78 <  color: #0E0E0E;
79 <  overflow: hidden;
80 < }
81 <
82 < #%MENU_ID% ul ul a{
83 <  padding: 0px 2px 0px 5px;
84 <  display: block;
85 <  background-color: #DCDCDC;
86 <  z-index:20;
87 < }
88 <
89 < #%MENU_ID% ul ul a:hover{
90 <  background-color: #0EEEEE;
91 < }
92 <
93 < #%MENU_ID% ul ul a.linkSubMenu:link,
94 < #%MENU_ID% ul ul a.linkSubMenu:active,
95 < #%MENU_ID% ul ul a.linkSubMenu:visited{
96 <  font-weight: 800;
97 < }
98 < %ENDSECTION{"css"}%
99 < /* </pre> */ </style>
100 < """)
101 <    
15 >  
16 >        def makeSummary(self):
17 >            contents=self.contents
18 >            writeflag = False
19 >            for line in contents :
20 >                print line
21 >                print
22 >                if line=='# Summary\n' :
23 >                    writeflag = True
24 >                    continue
25 >                if line=='# Levels\n' :
26 >                    writeflag = False
27 >                    return
28 >                if line=='\n' :
29 >                    continue
30 >                if writeflag :
31 >                    self.page.write('         * '+line)
32                  
33  
34          def packlist(self):
# Line 113 | Line 43 | class mkDepMetrics(object) :
43              for line in contents :
44                  if line =='# Levels\n' :
45                      writeflag = True
46 +                    print line
47 +                    continue
48 +                elif not writeflag :
49                      continue
50                  if line=='\n':
51                      continue
# Line 129 | Line 62 | class mkDepMetrics(object) :
62                          continue
63                      else :
64                          temp =line.strip()
65 <                        pack[j].extend(temp)
66 <            
65 >                        print temp
66 >                        pack[j].append(temp)
67              return pack
68   # repack return list [[levels], [level1, [PACKEGE1,module1,module2,...], [PACKEGE2,module1,module2], ..],[level2,[],[],...] ...]
69          def repack(self,pack):
70 +            #print pack
71              listlen = len(pack)
72              pack2 = [['Levels']]
73              countpack = 0
# Line 167 | Line 101 | class mkDepMetrics(object) :
101              return pack2
102              
103          def dropdown(self,list):
104 <            self.page.write('<div id="test">\n\n')    
104 >            self.page.write('\n<div id="test">\n\n')    
105              listlen = len(list)
106              for level in range(1,listlen):
107                  self.page.write('   * !'+str(list[level][0][0])+'\n')
108                  for pack in range(1,len(list[level])):
109                      self.page.write('      * !'+str(list[level][pack][0])+'\n')
110                      for module in range(1,len(list[level][pack])):
111 <                        self.page.write('         * [[https://macms01.cern.ch/ap/ignominy/'+self.arch+'/'+self.package_name+'/igRun/subsystem.'+str(list[level][pack][0])+'/PROJECT-'+str(list[level][pack][0])+'-'+str(list[level][pack][module].replace('/','-'))+'-O.gif.html]['+str(list[level][pack][module])+']]\n')
111 >                        self.page.write('         * [[https://macms01.cern.ch/ap/ignominy/'+self.arch+'/'+self.packagename+'/igRun/subsystem.'+str(list[level][pack][0])+'/PROJECT-'+str(list[level][pack][0])+'-'+str(list[level][pack][module].replace('/','-'))+'-O.gif.html]['+str(list[level][pack][module])+']]\n')
112              self.page.write('</div>\n%INCLUDE{"Main.DropDownMenu" section="js" MENU_ID="test"}%\n<br><br>\n\n')
113  
114                    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines