diff --git a/Tools/src/python/IASApiDocs/PydocBuilder.py b/Tools/src/python/IASApiDocs/PydocBuilder.py index c2be912a5..bda4983f7 100644 --- a/Tools/src/python/IASApiDocs/PydocBuilder.py +++ b/Tools/src/python/IASApiDocs/PydocBuilder.py @@ -10,6 +10,7 @@ import os import shutil from subprocess import call +from glob import glob from IASApiDocs.DocGenerator import DocGenerator class PydocBuilder(DocGenerator): @@ -45,6 +46,67 @@ def getPythonFilesInFolder(self,folder): return ret + def buildIndex(self,folder): + """ + Build the index.thm file needed by github web server. + + The index will simply list the generated html files + + @param folder: the folder containing html files to index + """ + print "Generating index in",folder + + htmlFilePaths = glob(folder+"/*.html") + htmlFiles = [] + for f in htmlFilePaths: + parts = f.split("/") + fileName = parts[len(parts)-1] + htmlFiles.append(fileName) + htmlFiles.sort() + + # Look for python modules that can be taken from + # file names having 2 dots like IASApiDocs.DocGenerator.html + pyModules = [] + for f in htmlFiles: + parts = f.split(".") + if (len(parts)>2): + if (parts[0] not in pyModules): + pyModules.append(parts[0]) + pyModules.sort() + print "Python modules",pyModules + + msg = "\n
\n" + msg += "\t