CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Documentation/ReferenceManualScripts/doxygen/utils/configfiles/configfiles.py

Go to the documentation of this file.
00001 import sys
00002 
00003 def generateConfigFilesPage(PROJECT_LOCATION):
00004     input = open(PROJECT_LOCATION+"/doc/html/namespaces.html", "r")
00005     lines = input.read()
00006     input.close()
00007     
00008     # put nasty UL list to one line
00009     lines = lines.replace("\n<ul>", "<ul>")
00010     lines = lines.replace("<ul>\n", "<ul>")
00011     lines = lines.replace("\n</ul>", "</ul>")
00012     lines = lines.replace("</ul>\n", "</ul>")
00013     lines = lines.replace("\n<li>", "<li>")
00014     lines = lines.replace("<li>\n", "<li>")
00015     
00016     
00017     lines = lines.split("\n")
00018     html = []
00019     
00020     contentStarted = False  # table content started
00021     for line in lines:
00022         append = True;          # line is cff or cfi or cfg
00023         
00024         if (line.find("</table>") != -1) and (contentStarted):
00025             contentStarted = False
00026             
00027         if (contentStarted):
00028             if (line.find("<tr><td class=\"indexkey\">") == -1):    # Line stucture is wrong
00029                 append = False;
00030             else:
00031                 if (line.find("__cff.html") == -1) and \
00032                    (line.find("__cfg.html") == -1) and \
00033                    (line.find("__cfi.html") == -1):
00034                     append = False;
00035             
00036         if (line.find("<table>") != -1) and (not contentStarted):
00037             contentStarted = True            
00038             
00039         if (append):
00040             html.append(line)        
00041             
00042     # end "for line in lines"    
00043             
00044     html = "\n".join(html)
00045     
00046     output = open(PROJECT_LOCATION+"/doc/html/configfiles.html", "w")         
00047     output.write(html)
00048     output.close()
00049     
00050 if len(sys.argv) > 1:
00051     PROJECT_LOCATION = sys.argv[1]
00052     
00053     generateConfigFilesPage(PROJECT_LOCATION)
00054     
00055     print "configfiles.py done"
00056 else:
00057     print "Not enough parameters: configfiles.py PROJECT_LOCATION"    
00058     
00059