CMS 3D CMS Logo

Functions | Variables
TableParser Namespace Reference

Functions

def extractPages (configFileFlag=False)
 
def extractPagesForPackage ()
 
def generateTab (items, curr, tabClass='tabs3')
 

Variables

 allRows
 
 configFileFlag
 
 destTabClassName
 
 fileNameTemplate
 
 htmlFileName
 
 htmlFilePath
 
 htmlFullPath
 
 htmlPage
 
 newTab
 
 oldTab
 
 page
 
 pageNames
 
 pages
 
 table
 
 tableClassName
 
 temp
 

Function Documentation

◆ extractPages()

def TableParser.extractPages (   configFileFlag = False)

Definition at line 19 of file TableParser.py.

19 def extractPages(configFileFlag = False):
20  # initial page, A
21  pages = {'A':[]}
22  # find all class/namespace talbe rows.
23  table = htmlPage.find('table', {'class' : tableClassName})
24  for row in table.findAll('tr'):
25  # please see the related html file (annotated.html) to understand the
26  # approach here. you will see that, only hidden rows have style
27  # attribute and these hidden rows must be added to pages of their
28  # parents. This is why we need to check whether row has a style
29  # attribute or not.
30  styleFlag = False
31  if row.has_key('style'): styleFlag = True
32  # change the first letter if row is not hidden (child) one
33  if not styleFlag: firstLetter = row.findAll('td')[0].text[0].upper()
34  # if pages dict doesn't have the page yet..
35  if not pages.has_key(firstLetter):
36  pages[firstLetter] = []
37  # insert the row into the related page
38  if configFileFlag:
39  url = row.find('a')['href']
40  if '_cff' in url or '_cfi' in url or '_cfg' in url:
41  pages[firstLetter].append(row)
42  else:
43  pages[firstLetter].append(row)
44  return pages
45 
46 # load rows from the package documentation page. output structure:
47 # pages = {'PackageA' : [..], 'PackageB' : [...]}

References mps_setup.append, and pileupCalc.upper.

◆ extractPagesForPackage()

def TableParser.extractPagesForPackage ( )

Definition at line 48 of file TableParser.py.

49  # initial page, A
50  pages = {}
51  table = htmlPage.find('table', {'class' : tableClassName})
52  for row in table.findAll('tr'):
53  # first cell contains name of the package...
54  name = row.findAll('td')[0].text
55  # parse package names --please have a look at the pages.html file
56  name = name[name.find(' '):name.find('/')].strip()
57  # if the package is not added yet
58  if not pages.has_key(name): pages[name] = []
59  pages[name].append(row)
60  return pages
61 
62 # generate alphabetic tab for html pages that will be generated by this script

References mps_setup.append, and digitizers_cfi.strip.

◆ generateTab()

def TableParser.generateTab (   items,
  curr,
  tabClass = 'tabs3' 
)

Definition at line 63 of file TableParser.py.

63 def generateTab(items, curr, tabClass = 'tabs3'):
64  itemTagMap = {}; tab = ''
65  for item in items:
66  fn = fileNameTemplate % item.replace(' ', '_') # generate file name
67  if item != curr: tab += '<li><a href="%s">%s</a></li>' % (fn, item)
68  else: tab += '<li class="current"><a href="%s">%s</a></li>'%(fn, item)
69  return '<div class="%s"><ul class="tablist">%s</ul></div>' % (tabClass,tab)
70 

Variable Documentation

◆ allRows

TableParser.allRows

Definition at line 103 of file TableParser.py.

◆ configFileFlag

TableParser.configFileFlag

Definition at line 97 of file TableParser.py.

◆ destTabClassName

TableParser.destTabClassName

Definition at line 95 of file TableParser.py.

◆ fileNameTemplate

TableParser.fileNameTemplate

Definition at line 13 of file TableParser.py.

◆ htmlFileName

TableParser.htmlFileName

Definition at line 12 of file TableParser.py.

◆ htmlFilePath

TableParser.htmlFilePath

Definition at line 11 of file TableParser.py.

◆ htmlFullPath

TableParser.htmlFullPath

Definition at line 10 of file TableParser.py.

◆ htmlPage

TableParser.htmlPage

Definition at line 14 of file TableParser.py.

◆ newTab

TableParser.newTab

Definition at line 122 of file TableParser.py.

◆ oldTab

TableParser.oldTab

Definition at line 121 of file TableParser.py.

◆ page

TableParser.page

Definition at line 128 of file TableParser.py.

◆ pageNames

TableParser.pageNames

Definition at line 104 of file TableParser.py.

◆ pages

TableParser.pages

Definition at line 94 of file TableParser.py.

◆ table

TableParser.table

◆ tableClassName

TableParser.tableClassName

Definition at line 15 of file TableParser.py.

◆ temp

TableParser.temp

Definition at line 119 of file TableParser.py.

digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
TableParser.extractPagesForPackage
def extractPagesForPackage()
Definition: TableParser.py:48
TableParser.extractPages
def extractPages(configFileFlag=False)
Definition: TableParser.py:19
mps_setup.append
append
Definition: mps_setup.py:85
TableParser.generateTab
def generateTab(items, curr, tabClass='tabs3')
Definition: TableParser.py:63
pileupCalc.upper
upper
Definition: pileupCalc.py:214