CMS 3D CMS Logo

filesFinder.py
Go to the documentation of this file.
1 __author__="Aurelija"
2 __date__ ="$2010-07-15 12.27.32$"
3 
4 import re
5 from os.path import join
6 from Utilities.ReleaseScripts.cmsCodeRules.pathToRegEx import pathsToRegEx, pathToRegEx
7 
8 def getFilePathsFromWalk(osWalkResult, file, exceptPaths = []):
9 
10  listOfFiles = []
11 
12  file = pathToRegEx(file)
13 
14  for root, dirs, files in osWalkResult:
15  for name in files:
16  excepted = False
17  fullPath = join(root,name)
18  for path in pathsToRegEx(exceptPaths):
19  if re.match(path, fullPath):
20  excepted = True
21  break
22  if not excepted and re.match(file, name):
23  listOfFiles.append(fullPath)
24  return listOfFiles
filesFinder.getFilePathsFromWalk
def getFilePathsFromWalk(osWalkResult, file, exceptPaths=[])
Definition: filesFinder.py:8
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
pathToRegEx.pathsToRegEx
def pathsToRegEx(Paths)
Definition: pathToRegEx.py:7
pathToRegEx
Definition: pathToRegEx.py:1