CMS 3D CMS Logo

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

Functions

def pathToList
 
def readPicFiles
 
def splitToPackages
 

Variables

string __author__ = "Aurelija"
 
string __date__ = "$2010-08-13 14.28.08$"
 
list rulesNames = []
 
string slash = "\\"
 

Function Documentation

def pickleFileParser.pathToList (   path)

Definition at line 66 of file pickleFileParser.py.

References split.

Referenced by splitToPackages().

66 
67 def pathToList(path):
68  list = []
69  head, tail = split(path)
70  if tail != '':
71  list.insert(0, tail)
72  while head != '':
73  head, tail = split(head)
74  if tail != '':
75  list.insert(0, tail)
76  else:
77  break
78  return list
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 
17 def readPicFiles(directory, toSplit = False):
18 
19  ruleResult = {}
20  rulesResults = {}
21  picFiles = glob.glob(join(directory, "cmsCodeRule*.dat"))
22  picFiles.sort()
23 
24  for file in picFiles:
25  head, fileName = split(file)
26  ruleName = fileName[11:-4]
27  rulesNames.append(ruleName)
28 
29  file = open(file)
30  ruleResult = pickle.load(file)
31  if toSplit:
32  ruleResult = splitToPackages(ruleResult)
33 
34  rulesResults[ruleName] = ruleResult
35 
36  return rulesResults
37 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
double split
Definition: MVATrainer.cc:139
def pickleFileParser.splitToPackages (   ruleResult)

Definition at line 38 of file pickleFileParser.py.

References pathToList().

Referenced by readPicFiles().

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

Variable Documentation

string pickleFileParser.__author__ = "Aurelija"

Definition at line 1 of file pickleFileParser.py.

string pickleFileParser.__date__ = "$2010-08-13 14.28.08$"

Definition at line 2 of file pickleFileParser.py.

list pickleFileParser.rulesNames = []

Definition at line 9 of file pickleFileParser.py.

string pickleFileParser.slash = "\\"

Definition at line 12 of file pickleFileParser.py.

Referenced by FittedEntry.BuildName(), SummaryPlot.check(), CommissioningHistograms.copyCustomInformation(), FittedEntriesManager.createFileName(), PFRootEventManager.expand(), CommissioningHistograms.extractHistograms(), DQMImplNet< DQMNet::Object >.findObject(), DQMStore.makeDirectory(), DQMImplNet< DQMNet::Object >.makeObject(), EcalTrigPrimESProducer.parseTextFile(), DQMStore.readDirectory(), CommissioningHistograms.runNumber(), CommissioningHistograms.runType(), splitPath(), Measurement.Substitute2p(), and SiStripConfigDb.usingDatabase().