CMS 3D CMS Logo

Functions | Variables
pickleFileParser Namespace Reference

Functions

def pathToList (path)
 
def readPicFiles (directory, toSplit=False)
 
def splitToPackages (ruleResult)
 

Variables

 __author__
 
 __date__
 
 rulesNames
 
 slash
 

Function Documentation

def pickleFileParser.pathToList (   path)

Definition at line 64 of file pickleFileParser.py.

References split.

Referenced by splitToPackages().

64 def pathToList(path):
65  list = []
66  head, tail = split(path)
67  if tail != '':
68  list.insert(0, tail)
69  while head != '':
70  head, tail = split(head)
71  if tail != '':
72  list.insert(0, tail)
73  else:
74  break
75  return list
76 
77 
double split
Definition: MVATrainer.cc:139
def pickleFileParser.readPicFiles (   directory,
  toSplit = False 
)

Definition at line 16 of file pickleFileParser.py.

References join(), split, and splitToPackages().

Referenced by showPage.BuildViewer.showResults().

16 def readPicFiles(directory, toSplit = False):
17 
18  ruleResult = {}
19  rulesResults = {}
20  picFiles = sorted(glob.glob(join(directory, "cmsCodeRule*.dat")))
21 
22  for file in picFiles:
23  head, fileName = split(file)
24  ruleName = fileName[11:-4]
25  rulesNames.append(ruleName)
26 
27  file = open(file)
28  ruleResult = pickle.load(file)
29  if toSplit:
30  ruleResult = splitToPackages(ruleResult)
31 
32  rulesResults[ruleName] = ruleResult
33 
34  return rulesResults
35 
36 
def splitToPackages(ruleResult)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def readPicFiles(directory, toSplit=False)
double split
Definition: MVATrainer.cc:139
def pickleFileParser.splitToPackages (   ruleResult)

Definition at line 37 of file pickleFileParser.py.

References pathToList().

Referenced by readPicFiles().

37 def splitToPackages(ruleResult):
38 
39  packageResult = []
40  info = []
41 
42  if not ruleResult: return info
43 
44  ruleResult = sorted(ruleResult.items())
45  file, lines = ruleResult.pop(0)
46  pathList = pathToList(file)
47  package = slash.join(pathList[:2])
48  packageResult.append((slash.join(pathList[2:]), lines))
49 
50  for file, lines in ruleResult:
51  pathList = pathToList(file)
52  head = slash.join(pathList[:2])
53  tail = slash.join(pathList[2:])
54  if package == head:
55  packageResult.append((tail, lines))
56  else:
57  info.append((package, packageResult))
58  packageResult = []
59  package = head
60  packageResult.append((tail, lines))
61  info.append((package, packageResult))
62  return info #list of (package, packageResult)
63 
def splitToPackages(ruleResult)

Variable Documentation

pickleFileParser.__author__
private

Definition at line 1 of file pickleFileParser.py.

pickleFileParser.__date__
private

Definition at line 2 of file pickleFileParser.py.

pickleFileParser.rulesNames

Definition at line 9 of file pickleFileParser.py.