CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
packageDocSplitter Namespace Reference

Functions

def addMenuToHeader
 
def addTagToPackageDoc
 
def createHTMLFiles
 
def extractList
 
def parseTagList
 

Variables

list filename = sys.argv[1]
 
tuple html = addMenuToHeader(html, "")
 
tuple output = open(PROJECT_PATH+filename, "w")
 
list PROJECT_PATH = sys.argv[2]
 
dictionary SUBSYSTEMS = {}
 
dictionary TAGLIST = {}
 
list tagList = sys.argv[2]
 

Detailed Description

Created on Oct 27, 2011

@author: MantYdze

Function Documentation

def packageDocSplitter.addMenuToHeader (   header,
  subsys 
)

Definition at line 75 of file packageDocSplitter.py.

Referenced by createHTMLFiles().

75 
76 def addMenuToHeader(header, subsys):
77  menu = "<div class=\"tabs3\">\n"
78  menu += "<ul class=\"tablist\">\n"
79 
80  for subsystem in sorted(SUBSYSTEMS.keys()):
81  current = ""
82  if subsystem == subsys:
83  current = " class=\"current\""
84  menu += "<li"+current+"><a href=\"packageDocumentation_"+subsystem+".html\"><span>"+subsystem+"</span></a></li>\n"
85 
86  menu += "</ul>\n"
87  menu += "</div>\n"
88 
89  soap = BeautifulSoup(header)
90  div = soap.find("div", {"class":"tabs"})
91 
92  div.append(NavigableString(menu))
93 
94  return soap.renderContents()
def packageDocSplitter.addTagToPackageDoc (   line,
  subsystem,
  package 
)

Definition at line 24 of file packageDocSplitter.py.

References linker.replace().

Referenced by extractList().

24 
25 def addTagToPackageDoc(line, subsystem, package):
26  if (TAGLIST.has_key(subsystem+"/"+package)):
27  tag = TAGLIST[subsystem+"/"+package]
28 
29  path = line[line.find("href=\"")+6:line.find("\">")]
30 
31  input = open(PROJECT_PATH+path, "r")
32  source = input.read()
33  input.close()
34 
35  output = open(PROJECT_PATH+path, "w")
36  output.write(source.replace("@CVS_TAG@", tag).replace("Source code (CVS tag: @)", "Source code (CVS tag: "+tag+" )"))
37  output.close()
def replace
Definition: linker.py:10
def packageDocSplitter.createHTMLFiles (   header,
  footer,
  PROJECT_PATH 
)

Definition at line 95 of file packageDocSplitter.py.

References addMenuToHeader(), and relativeConstraints.keys.

95 
96 def createHTMLFiles(header, footer, PROJECT_PATH):
97  for subsystem in sorted(SUBSYSTEMS.keys()):
98  html = addMenuToHeader(header, subsystem)
99  html += "<ul>"
100 
101  for package in sorted(SUBSYSTEMS[subsystem].keys()):
102  html+="<li>"+SUBSYSTEMS[subsystem][package]+"</li>"
103  html+="</ul>"
104 
105  output = open(PROJECT_PATH+"packageDocumentation_"+subsystem+".html", "w")
106  output.write(html)
107  output.close()
108 
def packageDocSplitter.extractList (   filename)

Definition at line 38 of file packageDocSplitter.py.

References addTagToPackageDoc(), and join().

38 
39 def extractList(filename):
40  input = open(filename, "r")
41  source = input.read()
42  input.close()
43 
44  header = ""
45  headerFull = False
46  footer = ""
47  footerStarted = False
48 
49  lines = source.split("\n")
50 
51  for line in lines:
52 
53  if (line.find("<li><a class=\"el\"") != -1) and (line.find("Package ") != -1):
54  headerFull = True
55  title = line[line.find("Package ")+8:-4]
56  subsystem = title.split("/")[0]
57  package = "/".join(title.split("/")[1:])
58  if not SUBSYSTEMS.has_key(subsystem):
59  SUBSYSTEMS[subsystem] = {}
60  SUBSYSTEMS[subsystem][package] = line.replace("<li>","")
61 
62  addTagToPackageDoc(line, subsystem, package)
63 
64  if not headerFull:
65  header += line+"\n"
66 
67  if line.find("<hr class=\"footer\"/>") != -1:
68  footerStarted = True
69 
70  if footerStarted:
71  footer += line+"\n"
72 
73  return header, footer, source
74 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def packageDocSplitter.parseTagList (   tagList)

Definition at line 12 of file packageDocSplitter.py.

References split.

12 
13 def parseTagList(tagList):
14  input = open(tagList, "r")
15  source = input.read()
16  input.close()
17  lines = source.split("\n")
18 
19  for line in lines[4:-3]:
20  items = line.strip().split(" ")
21  package = items[0]
22  tag = items[-1]
23  TAGLIST[package] = tag
double split
Definition: MVATrainer.cc:139

Variable Documentation

list packageDocSplitter.filename = sys.argv[1]

Definition at line 110 of file packageDocSplitter.py.

tuple packageDocSplitter.html = addMenuToHeader(html, "")

Definition at line 117 of file packageDocSplitter.py.

Referenced by FWDialogBuilder.addHtml(), EcalEndcapMonitorXdaqClient.defaultWebPage(), EcalBarrelMonitorXdaqClient.defaultWebPage(), dqm::StateMachine.failurePage(), CgiWriter.output_preamble(), and dqm::StateMachine.statePage().

tuple packageDocSplitter.output = open(PROJECT_PATH+filename, "w")

Definition at line 118 of file packageDocSplitter.py.

list packageDocSplitter.PROJECT_PATH = sys.argv[2]

Definition at line 111 of file packageDocSplitter.py.

dictionary packageDocSplitter.SUBSYSTEMS = {}

Definition at line 9 of file packageDocSplitter.py.

dictionary packageDocSplitter.TAGLIST = {}

Definition at line 10 of file packageDocSplitter.py.

list packageDocSplitter.tagList = sys.argv[2]

Definition at line 112 of file packageDocSplitter.py.

Referenced by RPCBxTest.beginRun(), RPCNoisyStripTest.getMonitorElements(), RPCOccupancyTest.getMonitorElements(), RPCDeadChannelTest.getMonitorElements(), RPCClusterSizeTest.getMonitorElements(), and RPCMultiplicityTest.getMonitorElements().