Mercurial > hg > sv-dependency-builds
comparison src/portaudio/doc/utils/checkfiledocs.py @ 4:e13257ea84a4
Add bzip2, zlib, liblo, portaudio sources
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 13:59:52 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:6c505a35919a | 4:e13257ea84a4 |
---|---|
1 import os | |
2 import os.path | |
3 import string | |
4 | |
5 paRootDirectory = '../../' | |
6 paHtmlDocDirectory = os.path.join( paRootDirectory, "doc", "html" ) | |
7 | |
8 ## Script to check documentation status | |
9 ## this script assumes that html doxygen documentation has been generated | |
10 ## | |
11 ## it then walks the entire portaudio source tree and check that | |
12 ## - every source file (.c,.h,.cpp) has a doxygen comment block containing | |
13 ## - a @file directive | |
14 ## - a @brief directive | |
15 ## - a @ingroup directive | |
16 ## - it also checks that a corresponding html documentation file has been generated. | |
17 ## | |
18 ## This can be used as a first-level check to make sure the documentation is in order. | |
19 ## | |
20 ## The idea is to get a list of which files are missing doxygen documentation. | |
21 | |
22 | |
23 # recurse from top and return a list of all with the given | |
24 # extensions. ignore .svn directories. return absolute paths | |
25 def recursiveFindFiles( top, extensions, includePaths ): | |
26 result = [] | |
27 for (dirpath, dirnames, filenames) in os.walk(top): | |
28 if not '.svn' in dirpath: | |
29 for f in filenames: | |
30 if os.path.splitext(f)[1] in extensions: | |
31 if includePaths: | |
32 result.append( os.path.abspath( os.path.join( dirpath, f ) ) ) | |
33 else: | |
34 result.append( f ) | |
35 return result | |
36 | |
37 # generate the html file name that doxygen would use for | |
38 # a particular source file. this is a brittle conversion | |
39 # which i worked out by trial and error | |
40 def doxygenHtmlDocFileName( sourceFile ): | |
41 return sourceFile.replace( '_', '__' ).replace( '.', '_8' ) + '.html' | |
42 | |
43 | |
44 sourceFiles = recursiveFindFiles( paRootDirectory, [ '.c', '.h', '.cpp' ], True ); | |
45 docFiles = recursiveFindFiles( paHtmlDocDirectory, [ '.html' ], False ); | |
46 | |
47 | |
48 | |
49 currentFile = "" | |
50 | |
51 def printError( f, message ): | |
52 global currentFile | |
53 if f != currentFile: | |
54 currentFile = f | |
55 print f, ":" | |
56 print "\t!", message | |
57 | |
58 | |
59 for f in sourceFiles: | |
60 if not doxygenHtmlDocFileName( os.path.basename(f) ) in docFiles: | |
61 printError( f, "no doxygen generated doc page" ) | |
62 | |
63 s = file( f, 'rt' ).read() | |
64 | |
65 if not '/**' in s: | |
66 printError( f, "no doxygen /** block" ) | |
67 | |
68 if not '@file' in s: | |
69 printError( f, "no doxygen @file tag" ) | |
70 | |
71 if not '@brief' in s: | |
72 printError( f, "no doxygen @brief tag" ) | |
73 | |
74 if not '@ingroup' in s: | |
75 printError( f, "no doxygen @ingroup tag" ) | |
76 | |
77 |