| 143 | sys.stderr.write( "WARNING : {0} line {1} : {2}\n".format( filename, lineNumber + 1, message ) ) |
| 144 | |
| 145 | def category( includeFile, filename ) : |
| 146 | |
| 147 | if os.path.splitext( filename )[1] == ".cpp" : |
| 148 | name, ext = os.path.splitext( os.path.basename( includeFile ) ) |
| 149 | if ext == ".h" and name == os.path.splitext( os.path.basename( filename ) )[0] : |
| 150 | return "self" |
| 151 | |
| 152 | if includeFile == "boost/python.hpp" : |
| 153 | return "boostpython" |
| 154 | |
| 155 | if "/" in includeFile : |
| 156 | start = includeFile.partition( "/" )[0] |
| 157 | if start == "sys" : |
| 158 | return "stdc" |
| 159 | elif start in includeOrder : |
| 160 | return start |
| 161 | else : |
| 162 | return "unknown" |
| 163 | |
| 164 | if includeFile == "ft2build.h" : |
| 165 | return "freetypeBuild" |
| 166 | elif includeFile.startswith( "FT_" ) and includeFile.endswith( "_H" ) : |
| 167 | return "freetype" |
| 168 | |
| 169 | if not includeFile.islower() : |
| 170 | return "local" |
| 171 | |
| 172 | if includeFile == "ai.h" or includeFile.startswith( "ai_" ) : |
| 173 | return "arnold" |
| 174 | |
| 175 | if includeFile.endswith( ".h" ) : |
| 176 | return "stdc" |
| 177 | else : |
| 178 | return "stdc++" |
| 179 | |
| 180 | def formattedInclude( includeFile, category ) : |
| 181 | |