From: <bl...@us...> - 2003-05-25 17:16:51
|
Update of /cvsroot/cpptool/rfta/bin In directory sc8-pr-cvs1:/tmp/cvs-serv23097/bin Modified Files: lister.py Log Message: * added filtering, only c/c++ source files are 'astdumped'. Index: lister.py =================================================================== RCS file: /cvsroot/cpptool/rfta/bin/lister.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lister.py 4 May 2003 06:54:33 -0000 1.4 --- lister.py 25 May 2003 17:16:48 -0000 1.5 *************** *** 46,49 **** --- 46,52 ---- os.makedirs( directory ) + def extension( self ): + return os.path.splitext( self )[1] + class Tag: def __init__( self, name, content = None ): *************** *** 225,228 **** --- 228,235 ---- + def isSourceFile( path ): + ext = Path( path ).extension() + return ext in [ '.cpp', '.c', '.h', '.hpp', '.cc', '.CC', '.Cpp', '.hh', '.cxx'] + def listFilesIgnoreCVSDir( generator, dirName, fileNames ): if ( fileNames.count( 'CVS' ) > 0 ): *************** *** 230,234 **** for file in fileNames: file_path = os.path.join( dirName, file ) ! if os.path.isfile( file_path ): generator.generate( file_path ) --- 237,241 ---- for file in fileNames: file_path = os.path.join( dirName, file ) ! if os.path.isfile( file_path ) and isSourceFile( file_path ): generator.generate( file_path ) |