CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions
MainPageGenerator.MainPageGenerator Class Reference

MainPageGenerator class is used for generating main page that contains domain trees (Analysis, Calibration and Alignment, Core, DAQ etc.) More...

Public Member Functions

def __init__
 Constructor method. More...
 
def CreateBuildRefMan
 
def CreateNewMainPage
 
def ExportJSON
 
def GetFileName
 
def HTMLTreeAddItem
 
def HTMLTreeBegin
 
def HTMLTreeEnd
 
def ParseJsonFromURL
 
def PrepareData
 
def ReadFile
 
def WriteFile
 

Public Attributes

 classes
 
 classesSource
 
 classesURLs
 
 CMSSWURL
 
 CMSVER
 
 contentStamp
 
 data
 
 dataPath
 
 domains
 
 filesSource
 
 GitLink
 
 head
 
 links
 
 mainPageTemplate
 
 managers
 
 managersURL
 
 packages
 
 packageSource
 
 path
 
 title
 
 treePageTamplate
 
 tWikiLinks
 
 users
 
 usersURL
 

Private Member Functions

def __GetHTMLItemDepth
 
def __HTMLFileName
 
def __NewTreePage
 
def __ParseItem
 
def __ParseSubItem
 

Detailed Description

MainPageGenerator class is used for generating main page that contains domain trees (Analysis, Calibration and Alignment, Core, DAQ etc.)

Definition at line 5 of file MainPageGenerator.py.

Constructor & Destructor Documentation

def MainPageGenerator.MainPageGenerator.__init__ (   self,
  dataPath,
  path,
  cmsVer = "" 
)

Constructor method.

Parameters
dataPathparameter gives path of data directory that contains .js, .css and image files needed for generating tree pages
pathis the reference manual directory path and it is used as destination and source.
cmsVeris version of CMSSW.

Definition at line 10 of file MainPageGenerator.py.

10 
11  def __init__(self, dataPath, path, cmsVer = ""):
12  self.path = path
13  self.dataPath = dataPath
14 
15  self.CMSVER = cmsVer
16 
17  self.managersURL = 'http://cmsdoxy.web.cern.ch/cmsdoxy/tcproxy.php?type=managers'
18  self.usersURL = 'http://cmsdoxy.web.cern.ch/cmsdoxy/tcproxy.php?type=users'
19  self.CMSSWURL = 'http://cmsdoxy.web.cern.ch/cmsdoxy/tcproxy.php?type=packages&release=CMSSW_4_4_2'
20 
21  self.tWikiLinks = {'Analysis':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrab',
22  'Calibration and Alignment':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCalAli',
23  'Core':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrameWork',
24  'DAQ':'https://twiki.cern.ch/twiki/bin/view/CMS/TriDASWikiHome',
25  'DQM':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideDQM',
26  'Database':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCondDB',
27  'Documentation':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuide',
28  'Fast Simulation':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFastSimulation',
29  'Full Simulation':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideSimulation',
30  'Generators':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideEventGeneration',
31  'Geometry':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideDetectorDescription',
32  'HLT':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideHighLevelTrigger',
33  'L1':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideL1Trigger',
34  'Reconstruction':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideReco',
35  'Visualization':'https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideVisualization'}
36 
37  self.data = None
38 
39  self.GitLink = "https://github.com/cms-sw/cmssw/tree/" + self.CMSVER + "/%s/%s"
40 
41  self.title = "<center>\n<h1>CMSSW Documentation</h1>\n<h2>" + self.CMSVER + "</h2>\n</center>\n"
42  self.links = """
43 <p style="margin-left:10px;">
44 Learn <a href="ReferenceManual.html">how to build Reference Manual</a><br>
45 Learn more about <a target="_blank" href="http://www.stack.nl/~dimitri/doxygen/commands.html">special doxygen commands</a>
46 </p>\n\n"""
47  self.head = """
48 <!-- Content Script & Style -->
49 <script type="text/javascript">
50 var itemList = [];
51 
52 function toggleHoba(item, path)
53 {
54  for(var i = 0; i < itemList.length; i++)
55  {
56  if(itemList[i] == item)
57  {
58  var iframe = $("#"+itemList[i]+"_div").children("iframe:first");
59  if(!iframe.attr("src"))
60  {
61  iframe.attr("src", path)
62  }
63  $("#"+item+"_div").slideToggle();
64  }
65  else
66  $("#"+itemList[i]+"_div").slideUp();
67  }
68 }
69 
70 $(document).ready(function() {
71 searchBox.OnSelectItem(0);
72 $(".doctable").find("td").each(function(){ if (this.id.indexOf("hoba_") != -1)itemList.push(this.id);});
73 });
74 </script>
75 <style>
76 .DCRow
77 {
78  background: #eeeeff;
79  border-spacing: 0px;
80  padding: 0px;
81  border-bottom: 1px solid #c1c1dc;
82 }
83 
84 .DCRow:hover
85 {
86  background: #cde4ec;
87 }
88 </style>
89 <!-- Content Script & Style -->
90  """
91  self.contentStamp = '$CONTENT$'
92  self.mainPageTemplate = self.ReadFile("index.html")
93  self.WriteFile("index_backup.html", self.mainPageTemplate) #backup file
94  soup = BeautifulSoup(self.mainPageTemplate)
95  soup.head.insert(len(soup.head), self.head)
96 
97  contents = soup.find("div", { "class" : "contents" })
98  for child in contents.findChildren():
99  child.extract()
100  contents.insert(0, self.contentStamp)
101  self.mainPageTemplate = str(soup)
102  self.mainPageTemplate = self.mainPageTemplate.replace("CSCDQM Framework Guide", "")
103  self.mainPageTemplate = self.mainPageTemplate.replace('&lt;','<').replace('&gt;', '>')
104  print "Main page template created..."
105 
106  self.CreateBuildRefMan()
107  print "RefMan created..."
108 
109  self.treePageTamplate = self.ReadFile(self.dataPath + "tree_template.html", pathFlag = False)
110  self.classesSource = self.ReadFile("classes.html")
111  self.filesSource = self.ReadFile("files.html")
112  self.packageSource = self.ReadFile("pages.html")

Member Function Documentation

def MainPageGenerator.MainPageGenerator.__GetHTMLItemDepth (   self,
  item 
)
private

Definition at line 153 of file MainPageGenerator.py.

References prof2calltree.count.

154  def __GetHTMLItemDepth(self, item):
155  return item["id"].count("_") - 1 # 1 for doxygen 1.8.5, 2 for old ver.
def MainPageGenerator.MainPageGenerator.__HTMLFileName (   self,
  fileName 
)
private

Definition at line 156 of file MainPageGenerator.py.

References python.rootplot.root2matplotlib.replace().

157  def __HTMLFileName(self, fileName):
158  return fileName.lower().replace(' ', '_')
def MainPageGenerator.MainPageGenerator.__NewTreePage (   self,
  domain 
)
private

Definition at line 342 of file MainPageGenerator.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, ConfigFiles.ConfigFiles.data, CondIter< DataT >.data, MainPageGenerator.MainPageGenerator.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, python.DBCopy.DBCopy.data, MainPageGenerator.MainPageGenerator.HTMLTreeAddItem(), MainPageGenerator.MainPageGenerator.HTMLTreeBegin(), MainPageGenerator.MainPageGenerator.HTMLTreeEnd(), relativeConstraints.keys, python.rootplot.root2matplotlib.replace(), MainPageGenerator.MainPageGenerator.treePageTamplate, MainPageGenerator.MainPageGenerator.tWikiLinks, ConfigFiles.ConfigFiles.WriteFile(), and MainPageGenerator.MainPageGenerator.WriteFile().

Referenced by MainPageGenerator.MainPageGenerator.CreateNewMainPage().

343  def __NewTreePage(self, domain):
344 
345  if not self.data.has_key(domain): return
346 
347  content = ''
348  keysI = self.data[domain].keys()
349  keysI.sort()
350  for i in keysI:
351  if i == '__DATA__': continue
352  content += self.HTMLTreeBegin(i)
353  keysJ = self.data[domain][i].keys()
354  keysJ.sort()
355  for j in keysJ:
356 # if len(self.data[domain][i][j].keys()) == 1:
357 # if self.data[domain][i][j].has_key("__DATA__"):
358 # content += self.HTMLTreeAddItem(j, self.data[domain][i][j]["__DATA__"])
359 # else:
360 # content += self.HTMLTreeAddItem(j)
361 # continue
362  keysK = self.data[domain][i][j].keys()
363  keysK.sort()
364  length = len(keysK)
365 # content += "<!-- Begin -->"
366  if length > 1:
367  if self.data[domain][i][j].has_key("__DATA__"):
368  content += self.HTMLTreeBegin(j, self.data[domain][i][j]["__DATA__"])
369  else:
370  content += self.HTMLTreeBegin(j)
371  else:
372  if self.data[domain][i][j].has_key("__DATA__"):
373  content += self.HTMLTreeAddItem(j, self.data[domain][i][j]["__DATA__"], folder = True)
374  else:
375  content += self.HTMLTreeAddItem(j, folder = True)
376 
377  for k in keysK:
378  if k == '__DATA__': continue
379  if self.data[domain][i][j][k]["__DATA__"]: content += self.HTMLTreeAddItem(k, self.data[domain][i][j][k]["__DATA__"])
380  else: content += self.HTMLTreeAddItem(k)
381  if length > 1:
382  content += self.HTMLTreeEnd()
383 # content += "<!-- End -->"
384  content += self.HTMLTreeEnd()
385  if self.tWikiLinks.has_key(domain):
386  self.WriteFile("iframes/%s.html" % domain.lower().replace(' ', '_'), self.treePageTamplate % (domain, self.tWikiLinks[domain], content))
387  else:
388  print 'Warning: The twiki link of "%s" domain not found...' % domain
389  self.WriteFile("iframes/%s.html" % domain.lower().replace(' ', '_'), self.treePageTamplate % (domain, '#', content))
def MainPageGenerator.MainPageGenerator.__ParseItem (   self,
  str_ 
)
private

Definition at line 144 of file MainPageGenerator.py.

145  def __ParseItem(self, str_):
146  return str_[0:str_.find('/')]
def MainPageGenerator.MainPageGenerator.__ParseSubItem (   self,
  str_ 
)
private

Definition at line 147 of file MainPageGenerator.py.

148  def __ParseSubItem(self, str_):
149  if '/' in str_:
150  return str_[str_.find('/')+1:]
151  else:
152  return None
def MainPageGenerator.MainPageGenerator.CreateBuildRefMan (   self)

Definition at line 260 of file MainPageGenerator.py.

References MainPageGenerator.MainPageGenerator.contentStamp, ConfigFiles.ConfigFiles.WriteFile(), and MainPageGenerator.MainPageGenerator.WriteFile().

261  def CreateBuildRefMan(self):
262  content = """<h1>The Reference Manual </h1>
263  This is the CMSSW Reference Manual, the reference documentation of all classes and packages in CMSSW.<p>
264  This page explains how to write the documentation for your code.
265 
266  </p><h2>Class Documentation</h2>
267 
268  Classes and methods are documented with properly formatted <a target="_blank" class="el" href="d3/d88/namespacecomments.html">comments</a> in the code.<p>
269  Here is a template of a documented <a target="_blank" href="http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Documentation/CodingRules/Template.h?rev=HEAD&amp;cvsroot=CMSSW&amp;content-type=text/vnd.viewcvs-markup">.h file</a>, and of a <a target="_blank" href="http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Documentation/CodingRules/Template.cc?rev=HEAD&amp;cvsroot=CMSSW&amp;content-type=text/vnd.viewcvs-markup">.cc file</a>. The resulting doxygen page is <a target="_blank" class="el" href="d6/d3e/classTemplate.html">here</a>.
270 
271  </p><h2>Package Documentation</h2>
272 
273  Each package should contain a very brief description of its content and purpose. Remember that this is a reference, and not a user's guide: tutorials, howtos, etc. are best documented in the <a target="_blank" href="https://twiki.cern.ch/twiki/bin/view/CMS/SWGuide">CMS Offline Guide</a> and in the <a target="_blank" href="https://twiki.cern.ch/twiki/bin/view/CMS/WorkBook">WorkBook</a>. Cross links between the CMS Offline Guide and the WorkBook and this manual are a good way to avoid duplication of content.<p>
274  This documentation should be written in a file [Package]/doc/[Package].doc. The simplest way of doing this is to go to the doc/ directory in your package and then run the script
275  <a target="_blank" href="http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/*checkout*/CMSSW/Documentation/ReferenceManualScripts/scripts/makePackageDoc?rev=HEAD&amp;cvsroot=CMSSW">makePackageDoc</a>,
276  which is available in your PATH.
277 
278  </p><h2> How to generate your documentation locally </h2>
279  One you have updated your documentation, you can look at how it displays in the following way:
280 
281  <ul>
282  <li>check out the following packages:
283  <pre> &gt; cmsrel CMSSW_7_X_X
284  &gt; cd CMSSW_7_X_X/
285  &gt; cmsenv
286  &gt; git cms-addpkg Documentation
287 
288  &gt; generate_reference_manual
289 
290  wait...
291 
292  &gt; firefox doc/html/index.html </pre>
293  </li>
294  </ul>"""
295  self.WriteFile('ReferenceManual.html', self.mainPageTemplate.replace(self.contentStamp, content))
def MainPageGenerator.MainPageGenerator.CreateNewMainPage (   self,
  outputFileName 
)

Definition at line 296 of file MainPageGenerator.py.

References MainPageGenerator.MainPageGenerator.__NewTreePage(), MainPageGenerator.MainPageGenerator.contentStamp, CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, ConfigFiles.ConfigFiles.data, CondIter< DataT >.data, MainPageGenerator.MainPageGenerator.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, python.DBCopy.DBCopy.data, MainPageGenerator.MainPageGenerator.links, ConfigFiles.ConfigFiles.PrepareData(), MainPageGenerator.MainPageGenerator.PrepareData(), python.rootplot.root2matplotlib.replace(), MainPageGenerator.MainPageGenerator.title, big::bigHeader.title, TrackerMap.title, ConfigFiles.ConfigFiles.WriteFile(), and MainPageGenerator.MainPageGenerator.WriteFile().

297  def CreateNewMainPage(self, outputFileName):
298  if self.data == None:
299  self.PrepareData()
300 
301  contents = """
302  <table class="doctable" border="0" cellpadding="0" cellspacing="0">
303  <tbody>
304  <tr class="top" valign="top">
305  <th class="domain">Domain</th><th class="contact">Contact</th>
306  </tr>
307  """
308  keysI = self.data.keys()
309  keysI.sort()
310  for i in keysI:
311  #########################
312  if i == 'Other': continue
313 
314  self.__NewTreePage(i)
315  contents = contents + '\n<tr class="DCRow">\n' ######### TAG: TR1
316  #########################
317  if i == 'Operations':
318  contents = contents + """<td width="50%%" style="padding:8px">%s</td>\n""" % i
319  else:
320  contents = contents + """<td width="50%%" style="padding:8px;cursor:pointer" onclick="toggleHoba('hoba_%s', 'iframes/%s.html')" id="hoba_%s"><a>%s</a></td>\n""" % (i.replace(' ', '_'), i.lower().replace(' ', '_'), i.replace(' ', '_'), i)
321  #########################
322 
323  contents = contents + '<td width="50%" class="contact">'
324  for j in range(len(self.data[i]["__DATA__"]["Contact"])):
325  if j == len(self.data[i]["__DATA__"]["Contact"]) - 1:
326  contents = contents + '<a href="mailto:%s">%s</a> ' % (self.data[i]["__DATA__"]["Contact"][j][1], self.data[i]["__DATA__"]["Contact"][j][0])
327  else:
328  contents = contents + '<a href="mailto:%s">%s</a>, ' % (self.data[i]["__DATA__"]["Contact"][j][1], self.data[i]["__DATA__"]["Contact"][j][0])
329  contents = contents + '</td>\n'
330  contents = contents + '</tr>\n\n' ######### TAG: TR1
331  #########################
332  if i == 'Operations': continue
333  #########################
334  contents = contents + """
335  <tr><td colspan="2" style="background:#d7dbe3">
336  <div style="display:none;" id="hoba_%s_div"><iframe width="100%%" frameborder="0"></iframe></div>
337  </td></tr>
338  """ % (i.replace(' ', '_'))
339 
340  contents = contents + "</table>"
341  self.WriteFile(outputFileName, self.mainPageTemplate.replace(self.contentStamp, self.title + contents + self.links))
def MainPageGenerator.MainPageGenerator.ExportJSON (   self,
  fileName 
)

Definition at line 255 of file MainPageGenerator.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, ConfigFiles.ConfigFiles.data, CondIter< DataT >.data, MainPageGenerator.MainPageGenerator.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, python.DBCopy.DBCopy.data, ConfigFiles.ConfigFiles.PrepareData(), MainPageGenerator.MainPageGenerator.PrepareData(), ConfigFiles.ConfigFiles.WriteFile(), and MainPageGenerator.MainPageGenerator.WriteFile().

256  def ExportJSON(self, fileName):
257  if self.data == None:
258  self.PrepareData()
259  self.WriteFile(fileName, json.dumps(self.data, indent = 1))
def MainPageGenerator.MainPageGenerator.GetFileName (   self,
  fileName 
)
This method returns file name without extension

Definition at line 132 of file MainPageGenerator.py.

133  def GetFileName(self, fileName):
134  """This method returns file name without extension"""
135  if '.' in fileName:
136  return fileName[0:fileName.find('.')]
137  else:
138  return fileName
def MainPageGenerator.MainPageGenerator.HTMLTreeAddItem (   self,
  title,
  links = None,
  endNode = False,
  folder = False 
)

Definition at line 402 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage().

403  def HTMLTreeAddItem(self, title, links = None, endNode = False, folder = False):
404  if endNode: html = '\t<li class="last">'
405  else: html = '\t<li>'
406 
407  if type(links) == str or type(links) == type(u''):
408  if folder:
409  html = html + '\t<a href="%s" target="_blank" class=""><span class="emptyFolder">%s</span></a>\n' % (links, title)
410  else:
411  html = html + '\t<a href="%s" target="_blank" class=""><span class="file">%s</span></a>\n' % (links, title)
412  elif type(links) == dict:
413  if folder:
414  html = html + '<span class="emptyFolder">%s ' % title
415  else:
416  html = html + '<span class="file">%s ' % title
417  for i in links.keys():
418  html = html + '<a target="_blank" href="%s">[%s]</a> \n' % (links[i], i)
419  html = html + '</span>'
420  else:
421  html = html + '\t<span class="file">%s</span>\n' % title
422  return html + '\t</li>\n'
def MainPageGenerator.MainPageGenerator.HTMLTreeBegin (   self,
  title,
  links = {} 
)

Definition at line 390 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage().

391  def HTMLTreeBegin(self, title, links = {}):
392  html = '\n<li>\n<div class="hitarea expandable-hitarea"></div>\n'
393  html = html + '<span class="folder">%s\n' % title
394  for i in links.keys():
395  html = html + '<a target="_blank" href="%s">[%s]</a> \n' % (links[i], i)
396  html = html + '</span>\n'
397  html = html + '<ul style="display: block;">\n'
398  return html
def MainPageGenerator.MainPageGenerator.HTMLTreeEnd (   self)

Definition at line 399 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage().

400  def HTMLTreeEnd(self):
401  return '</li></ul>\n\n'
def MainPageGenerator.MainPageGenerator.ParseJsonFromURL (   self,
  URL 
)
This method returns data which is read from URL

Definition at line 139 of file MainPageGenerator.py.

140  def ParseJsonFromURL(self, URL):
141  """This method returns data which is read from URL"""
142  u = urllib2.urlopen(URL)
143  return json.loads(u.read())
def MainPageGenerator.MainPageGenerator.PrepareData (   self)

Definition at line 159 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.CreateNewMainPage(), PackageSplitter.PackageSplitter.CreatePackagePage(), PackageSplitter.PackageSplitter.CreateSubPage(), and MainPageGenerator.MainPageGenerator.ExportJSON().

160  def PrepareData(self):
161  self.managers = self.ParseJsonFromURL(self.managersURL)
162  print "Managers loaded and parsed..."
163 
164  self.users = self.ParseJsonFromURL(self.usersURL)
165  print "Users loaded and parsed..."
166 
167  self.data = {}
168  for i in self.managers.keys():
169  self.data[i] = {"__DATA__":{"Contact":[]}}
170  for j in self.managers[i]:
171  self.data[i]["__DATA__"]["Contact"].append(self.users[j])
172  self.domains = self.ParseJsonFromURL(self.CMSSWURL)
173  print "Domains loaded and parsed..."
174 
175  for i in self.domains.keys():
176  for j in self.domains[i]:
177  if not self.data[i].has_key(self.__ParseItem(j)):
178  self.data[i][self.__ParseItem(j)] = {}
179  if not self.data[i][self.__ParseItem(j)].has_key(self.__ParseSubItem(j)):
180  self.data[i][self.__ParseItem(j)][self.__ParseSubItem(j)] = {}
181 
182  self.data[i][self.__ParseItem(j)][self.__ParseSubItem(j)]["__DATA__"] = {
183  'git': self.GitLink % (self.__ParseItem(j), self.__ParseSubItem(j))
184  }
185 
186  # for getting package links
187  soup = BeautifulSoup(self.packageSource)
188  contents = soup.find("div", { "class" : "contents" })
189  li = contents.findAll("tr", {})
190 
191  self.packages = {}
192  for i in li:
193  if i.a["href"]:
194  self.packages[i.a.text] = i.a["href"]
195  print "Packages parsed(%d)..." % len(self.packages)
196 
197  # for getting items from file.html
198  soup = BeautifulSoup(self.filesSource)
199  contents = soup.find("div", { "class" : "contents" })
200  tr = contents.findAll("tr", {})
201  self.classes= {}
202  origin = 0
203  if tr[0].text == 'src': origin = -1
204  # depth of interface items can be only 3
205  flag = False
206  for i in tr:
207  if self.__GetHTMLItemDepth(i) + origin == 1:
208  self.classes[i.text] = {}
209  level1 = i.text
210  flag = False
211 
212  if self.__GetHTMLItemDepth(i) + origin == 2:
213  self.classes[level1][i.text] = {}
214  level2 = i.text
215  flag = False
216 
217  if self.__GetHTMLItemDepth(i) + origin == 3 and i.text == u'interface':
218  flag = True
219  if self.__GetHTMLItemDepth(i) + origin == 3 and i.text != u'interface':
220  flag = False
221 
222 # print i.text, self.__GetHTMLItemDepth(i)
223 # raw_input()
224 
225  if flag and i.text != u'interface':
226  self.classes[level1][level2][i.text] = i.a["href"]
227  #self.ZEG = i
228  print "Class hierarchy loaded(%d)..." % len(self.classes)
229 
230 # self.WriteFile("dbg.json", json.dumps(self.classes, indent = 1))
231 
232  # for parsing classes links from classes.html
233  soup = BeautifulSoup(self.classesSource)
234  contents = soup.find("div", { "class" : "contents" })
235  td = contents.findAll("td", {})
236  self.classesURLs = {}
237  # add items to self.classesURLs
238  for i in td:
239  if i.a and i.a.has_key('href'):
240  self.classesURLs[i.a.text] = i.a['href']
241  print "Class URLs was loaded... (%s)" % len(self.classesURLs)
242 
243  for i in self.data.keys():
244  for j in self.data[i].keys():
245  if not self.classes.has_key(j): continue
246  for k in self.data[i][j].keys():
247  if "Package " + j + "/" + k in self.packages:
248  self.data[i][j][k]["__DATA__"]["packageDoc"] = '../' + self.packages["Package " + j + "/" + k]
249  if not self.classes[j].has_key(k): continue
250  for h in self.classes[j][k]:
251  if self.classesURLs.has_key(self.GetFileName(h)):
252  self.data[i][j][k][self.GetFileName(h)] = {"__DATA__": '../' + self.classesURLs[self.GetFileName(h)]}
253  else:
254  self.data[i][j][k][self.GetFileName(h) + ".h"] = {"__DATA__": '../' + self.classes[j][k][h]}
def MainPageGenerator.MainPageGenerator.ReadFile (   self,
  fileName,
  pathFlag = True 
)
This method reads file directly or from path.

Definition at line 113 of file MainPageGenerator.py.

References ConfigFiles.ConfigFiles.path, MainPageGenerator.MainPageGenerator.path, and ConfigBuilder.ConfigBuilder.path.

Referenced by PackageSplitter.PackageSplitter.AddTab2Page().

114  def ReadFile(self, fileName, pathFlag = True):
115  """This method reads file directly or from path."""
116  if pathFlag:
117  print "Read:", self.path + fileName
118  f = open(self.path + fileName)
119  else:
120  f = open(fileName)
121  print "Read:", fileName
122  data = f.read()
123  f.close()
124  return data
def MainPageGenerator.MainPageGenerator.WriteFile (   self,
  fileName,
  data 
)
This method writes data

Definition at line 125 of file MainPageGenerator.py.

References ConfigFiles.ConfigFiles.path, MainPageGenerator.MainPageGenerator.path, and ConfigBuilder.ConfigBuilder.path.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage(), PackageSplitter.PackageSplitter.AddTab2Page(), MainPageGenerator.MainPageGenerator.CreateBuildRefMan(), MainPageGenerator.MainPageGenerator.CreateNewMainPage(), PackageSplitter.PackageSplitter.CreatePackagePage(), PackageSplitter.PackageSplitter.CreateSubPage(), and MainPageGenerator.MainPageGenerator.ExportJSON().

126  def WriteFile(self, fileName, data):
127  """This method writes data"""
128  print "Write:", self.path + fileName
129  f = open(self.path + fileName, "w")
130  f.write(data)
131  f.close()

Member Data Documentation

MainPageGenerator.MainPageGenerator.classes

Definition at line 200 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.classesSource

Definition at line 109 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.classesURLs

Definition at line 235 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.CMSSWURL

Definition at line 18 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.CMSVER

Definition at line 14 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.contentStamp

Definition at line 90 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.CreateBuildRefMan(), and MainPageGenerator.MainPageGenerator.CreateNewMainPage().

MainPageGenerator.MainPageGenerator.data

Definition at line 36 of file MainPageGenerator.py.

Referenced by cuy.FindIssue.__init__(), MainPageGenerator.MainPageGenerator.__NewTreePage(), MainPageGenerator.MainPageGenerator.CreateNewMainPage(), PackageSplitter.PackageSplitter.CreatePackagePage(), PackageSplitter.PackageSplitter.CreateSubPage(), confdb.HLTProcess.customize(), confdb.HLTProcess.dump(), MainPageGenerator.MainPageGenerator.ExportJSON(), confdb.HLTProcess.getRawConfigurationFromDB(), and confdb.HLTProcess.releaseSpecificCustomize().

MainPageGenerator.MainPageGenerator.dataPath

Definition at line 12 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.domains

Definition at line 171 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.filesSource

Definition at line 110 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.GitLink

Definition at line 38 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.head

Definition at line 46 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.links

Definition at line 41 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.CreateNewMainPage().

MainPageGenerator.MainPageGenerator.mainPageTemplate

Definition at line 91 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.managers

Definition at line 160 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.managersURL

Definition at line 16 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.packages

Definition at line 190 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.packageSource

Definition at line 111 of file MainPageGenerator.py.

Referenced by PackageSplitter.PackageSplitter.CreatePackagePage(), PackageSplitter.PackageSplitter.CreateSubPage(), and PackageSplitter.PackageSplitter.PrepareData().

MainPageGenerator.MainPageGenerator.path

Definition at line 11 of file MainPageGenerator.py.

Referenced by python.rootplot.rootmath.Target.__repr__(), PackageSplitter.PackageSplitter.ReadFile(), MainPageGenerator.MainPageGenerator.ReadFile(), PackageSplitter.PackageSplitter.WriteFile(), and MainPageGenerator.MainPageGenerator.WriteFile().

MainPageGenerator.MainPageGenerator.title

Definition at line 40 of file MainPageGenerator.py.

Referenced by cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), Vispa.Views.LineDecayView.LineDecayContainer.autolayout(), Vispa.Views.LineDecayView.LineDecayContainer.autolayoutThreadFinished(), python.rootplot.root2matplotlib.HistStack.bar(), python.rootplot.root2matplotlib.HistStack.bar3d(), python.rootplot.root2matplotlib.HistStack.barcluster(), python.rootplot.root2matplotlib.HistStack.barh(), python.rootplot.root2matplotlib.HistStack.barstack(), Vispa.Views.LineDecayView.LineDecayContainer.childFinishedAutolayouting(), MainPageGenerator.MainPageGenerator.CreateNewMainPage(), python.rootplot.root2matplotlib.HistStack.errorbar(), python.rootplot.root2matplotlib.HistStack.errorbarh(), Formatter.SimpleHTMLFormatter.headers(), python.rootplot.root2matplotlib.HistStack.histstack(), Vispa.Gui.PortWidget.PortWidget.name(), python.rootplot.root2matplotlib.Hist.show_titles(), python.rootplot.utilities.Hist.TGraph(), python.rootplot.utilities.Hist.TH1F(), python.rootplot.utilities.Hist2D.TH2F(), and python.rootplot.root2matplotlib.Hist2D.TH2F().

MainPageGenerator.MainPageGenerator.treePageTamplate

Definition at line 108 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage().

MainPageGenerator.MainPageGenerator.tWikiLinks

Definition at line 20 of file MainPageGenerator.py.

Referenced by MainPageGenerator.MainPageGenerator.__NewTreePage().

MainPageGenerator.MainPageGenerator.users

Definition at line 163 of file MainPageGenerator.py.

MainPageGenerator.MainPageGenerator.usersURL

Definition at line 17 of file MainPageGenerator.py.