CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
configfiles.py
Go to the documentation of this file.
1 import sys
2 
3 def generateConfigFilesPage(PROJECT_LOCATION):
4  input = open(PROJECT_LOCATION+"/doc/html/namespaces.html", "r")
5  lines = input.read()
6  input.close()
7 
8  # put nasty UL list to one line
9  lines = lines.replace("\n<ul>", "<ul>")
10  lines = lines.replace("<ul>\n", "<ul>")
11  lines = lines.replace("\n</ul>", "</ul>")
12  lines = lines.replace("</ul>\n", "</ul>")
13  lines = lines.replace("\n<li>", "<li>")
14  lines = lines.replace("<li>\n", "<li>")
15 
16 
17  lines = lines.split("\n")
18  html = []
19 
20  contentStarted = False # table content started
21  for line in lines:
22  append = True; # line is cff or cfi or cfg
23 
24  if (line.find("</table>") != -1) and (contentStarted):
25  contentStarted = False
26 
27  if (contentStarted):
28  if (line.find("<tr><td class=\"indexkey\">") == -1): # Line stucture is wrong
29  append = False;
30  else:
31  if (line.find("__cff.html") == -1) and \
32  (line.find("__cfg.html") == -1) and \
33  (line.find("__cfi.html") == -1):
34  append = False;
35 
36  if (line.find("<table>") != -1) and (not contentStarted):
37  contentStarted = True
38 
39  if (append):
40  html.append(line)
41 
42  # end "for line in lines"
43 
44  html = "\n".join(html)
45 
46  output = open(PROJECT_LOCATION+"/doc/html/configfiles.html", "w")
47  output.write(html)
48  output.close()
49 
50 if len(sys.argv) > 1:
51  PROJECT_LOCATION = sys.argv[1]
52 
53  generateConfigFilesPage(PROJECT_LOCATION)
54 
55  print "configfiles.py done"
56 else:
57  print "Not enough parameters: configfiles.py PROJECT_LOCATION"
58 
59 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def generateConfigFilesPage
Definition: configfiles.py:3