CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Utilities/ReleaseScripts/python/cmsCodeRules/filesFinder.py

Go to the documentation of this file.
00001 __author__="Aurelija"
00002 __date__ ="$2010-07-15 12.27.32$"
00003 
00004 import re
00005 from os.path import join
00006 from Utilities.ReleaseScripts.cmsCodeRules.pathToRegEx import pathsToRegEx, pathToRegEx
00007 
00008 def getFilePathsFromWalk(osWalkResult, file, exceptPaths = []):
00009 
00010     listOfFiles = []
00011 
00012     file = pathToRegEx(file)
00013 
00014     for root, dirs, files in osWalkResult:
00015         for name in files:
00016             excepted = False
00017             fullPath = join(root,name)
00018             for path in pathsToRegEx(exceptPaths):
00019                 if re.match(path, fullPath):
00020                     excepted = True
00021                     break
00022             if not excepted and re.match(file, name):
00023                 listOfFiles.append(fullPath)
00024     return listOfFiles