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 21 of file TableParser.py.

References mps_setup.append.

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

◆ extractPagesForPackage()

def TableParser.extractPagesForPackage ( )

Definition at line 50 of file TableParser.py.

References mps_setup.append, and digitizers_cfi.strip.

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

◆ generateTab()

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

Definition at line 65 of file TableParser.py.

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

Variable Documentation

◆ allRows

TableParser.allRows

Definition at line 105 of file TableParser.py.

◆ configFileFlag

TableParser.configFileFlag

Definition at line 99 of file TableParser.py.

◆ destTabClassName

TableParser.destTabClassName

Definition at line 97 of file TableParser.py.

◆ fileNameTemplate

TableParser.fileNameTemplate

Definition at line 15 of file TableParser.py.

◆ htmlFileName

TableParser.htmlFileName

Definition at line 14 of file TableParser.py.

◆ htmlFilePath

TableParser.htmlFilePath

Definition at line 13 of file TableParser.py.

◆ htmlFullPath

TableParser.htmlFullPath

Definition at line 12 of file TableParser.py.

◆ htmlPage

TableParser.htmlPage

Definition at line 16 of file TableParser.py.

◆ newTab

TableParser.newTab

Definition at line 124 of file TableParser.py.

◆ oldTab

TableParser.oldTab

Definition at line 123 of file TableParser.py.

◆ page

TableParser.page

Definition at line 130 of file TableParser.py.

◆ pageNames

TableParser.pageNames

Definition at line 106 of file TableParser.py.

◆ pages

TableParser.pages

Definition at line 96 of file TableParser.py.

◆ table

TableParser.table

◆ tableClassName

TableParser.tableClassName

Definition at line 17 of file TableParser.py.

◆ temp

TableParser.temp

Definition at line 121 of file TableParser.py.