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 66 of file pickleFileParser.py.

References split.

Referenced by splitToPackages().

66 def pathToList(path):
67  list = []
68  head, tail = split(path)
69  if tail != '':
70  list.insert(0, tail)
71  while head != '':
72  head, tail = split(head)
73  if tail != '':
74  list.insert(0, tail)
75  else:
76  break
77  return list
78 
79 
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 = glob.glob(join(directory, "cmsCodeRule*.dat"))
21  picFiles.sort()
22 
23  for file in picFiles:
24  head, fileName = split(file)
25  ruleName = fileName[11:-4]
26  rulesNames.append(ruleName)
27 
28  file = open(file)
29  ruleResult = pickle.load(file)
30  if toSplit:
31  ruleResult = splitToPackages(ruleResult)
32 
33  rulesResults[ruleName] = ruleResult
34 
35  return rulesResults
36 
37 
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 38 of file pickleFileParser.py.

References pathToList().

Referenced by readPicFiles().

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