2 Created on Oct 27, 2011
7 from BeautifulSoup
import BeautifulSoup, NavigableString
13 input = open(tagList,
"r")
16 lines = source.split("\n")
18 for line
in lines[4:-3]:
19 items = line.strip().
split(
" ")
22 TAGLIST[package] = tag
25 if (TAGLIST.has_key(subsystem+
"/"+package)):
26 tag = TAGLIST[subsystem+
"/"+package]
28 path = line[line.find(
"href=\"")+6:line.find(
"\">")]
30 input = open(PROJECT_PATH+path,
"r")
34 output = open(PROJECT_PATH+path, "w")
35 output.write(source.replace(
"@CVS_TAG@", tag).
replace(
"Source code (CVS tag: @)",
"Source code (CVS tag: "+tag+
" )"))
39 input = open(filename,
"r")
48 lines = source.split(
"\n")
52 if (line.find(
"<li><a class=\"el\"") != -1)
and (line.find(
"Package ") != -1):
54 title = line[line.find(
"Package ")+8:-4]
55 subsystem = title.split(
"/")[0]
56 package =
"/".
join(title.split(
"/")[1:])
57 if not SUBSYSTEMS.has_key(subsystem):
58 SUBSYSTEMS[subsystem] = {}
59 SUBSYSTEMS[subsystem][package] = line.replace(
"<li>",
"")
66 if line.find(
"<hr class=\"footer\"/>") != -1:
72 return header, footer, source
76 menu =
"<div class=\"tabs3\">\n"
77 menu +=
"<ul class=\"tablist\">\n"
79 for subsystem
in sorted(SUBSYSTEMS.keys()):
81 if subsystem == subsys:
82 current =
" class=\"current\""
83 menu +=
"<li"+current+
"><a href=\"packageDocumentation_"+subsystem+
".html\"><span>"+subsystem+
"</span></a></li>\n"
89 div = soap.find(
"div", {
"class":
"tabs"})
93 return soap.renderContents()
96 for subsystem
in sorted(SUBSYSTEMS.keys()):
100 for package
in sorted(SUBSYSTEMS[subsystem].
keys()):
101 html+=
"<li>"+SUBSYSTEMS[subsystem][package]+
"</li>"
104 output = open(PROJECT_PATH+
"packageDocumentation_"+subsystem+
".html",
"w")
109 if len(sys.argv) == 4:
110 filename = sys.argv[1]
111 PROJECT_PATH = sys.argv[2]+
"/doc/html/"
112 tagList = sys.argv[2]+
"/"+sys.argv[3]
114 (header, footer, html) =
extractList(PROJECT_PATH+filename)
118 output = open(PROJECT_PATH+filename,
"w")
122 print "not enough parameters"
123 print "#1 package documentation file (html) to split by subsystems"
124 print "#2 path to buildarea (must end with CMSSW_x_y_y)"
125 print "#3 list generated by showtags -t"
126 print "i.e. pages.html /data/refman/CMSSW_5_0_0 tagList.txt"
static std::string join(char **cmd)