2 __date__ =
"$Jul 12, 2010 10:08:20 AM$" 7 def finds(fileList, regularExpression, exceptRegEx = []):
11 for i
in range(len(fileList)):
12 if type(fileList[0]).__name__ !=
'tuple':
14 lines =
find(fileList[i], regularExpression, exceptRegEx)
17 lines =
find(fileList[i][1], regularExpression, exceptRegEx)
20 info.append((file, lines))
26 def find(file, regularExpression, exceptRegEx = []):
29 if type(file).__name__ !=
'list':
30 fileLines = open(file).readlines()
31 else: fileLines = file
32 for i
in range(len(fileLines)):
33 matchException =
False 34 if re.search(regularExpression, fileLines[i]) !=
None:
35 for regEx
in exceptRegEx:
36 if re.search(regEx, fileLines[i]) !=
None:
39 if not matchException:
def find(file, regularExpression, exceptRegEx=[])
def finds(fileList, regularExpression, exceptRegEx=[])