CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
keyFinder Namespace Reference

Functions

def find
 
def finds
 

Variables

string __author__ = "Aurelija"
 
string __date__ = "$Jul 12, 2010 10:08:20 AM$"
 

Function Documentation

def keyFinder.find (   file,
  regularExpression,
  exceptRegEx = [] 
)

Definition at line 27 of file keyFinder.py.

References sistrip::SpyUtilities.range().

Referenced by finds().

27 
28 def find(file, regularExpression, exceptRegEx = []):
29  lines = []
30 
31  if type(file).__name__ != 'list':
32  fileLines = open(file).readlines()
33  else: fileLines = file
34  for i in range(len(fileLines)):
35  matchException = False
36  if re.search(regularExpression, fileLines[i]) != None:
37  for regEx in exceptRegEx:
38  if re.search(regEx, fileLines[i]) != None:
39  matchException = True
40  break
41  if not matchException:
42  lines.append(i+1)
43  return lines
44 
def find
Definition: keyFinder.py:27
const uint16_t range(const Frame &aFrame)
def keyFinder.finds (   fileList,
  regularExpression,
  exceptRegEx = [] 
)

Definition at line 8 of file keyFinder.py.

References find(), and sistrip::SpyUtilities.range().

Referenced by cmsCodeRulesChecker.runRules().

8 
9 def finds(fileList, regularExpression, exceptRegEx = []):
10  info = []
11  lines = []
12 
13  for i in range(len(fileList)):
14  if type(fileList[0]).__name__ != 'tuple':
15  file = fileList[i]
16  lines = find(fileList[i], regularExpression, exceptRegEx)
17  else:
18  file = fileList[i][0]
19  lines = find(fileList[i][1], regularExpression, exceptRegEx)
20 
21  if lines:
22  info.append((file, lines))
23 
24  return info
25 
26 #file is the file path or the list of file lines
#exceptRegEx is the list of regular expressions that says to skip line if one of these regEx matches
def find
Definition: keyFinder.py:27
const uint16_t range(const Frame &aFrame)
def finds
Definition: keyFinder.py:8

Variable Documentation

string keyFinder.__author__ = "Aurelija"

Definition at line 2 of file keyFinder.py.

string keyFinder.__date__ = "$Jul 12, 2010 10:08:20 AM$"

Definition at line 3 of file keyFinder.py.