CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 64 of file pickleFileParser.py.

References submitPVValidationJobs.split().

Referenced by splitToPackages().

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

Definition at line 16 of file pickleFileParser.py.

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

Referenced by showPage.BuildViewer.showResults().

16 
17 def readPicFiles(directory, toSplit = False):
18 
19  ruleResult = {}
20  rulesResults = {}
21  picFiles = sorted(glob.glob(join(directory, "cmsCodeRule*.dat")))
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, 'rb')
29  ruleResult = pickle.load(file)
30  if toSplit:
31  ruleResult = splitToPackages(ruleResult)
32 
33  rulesResults[ruleName] = ruleResult
34 
35  return rulesResults
36 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def pickleFileParser.splitToPackages (   ruleResult)

Definition at line 37 of file pickleFileParser.py.

References pathToList().

Referenced by readPicFiles().

37 
38 def splitToPackages(ruleResult):
39 
40  packageResult = []
41  info = []
42 
43  if not ruleResult: return info
44 
45  ruleResult = sorted(ruleResult.items())
46  file, lines = ruleResult.pop(0)
47  pathList = pathToList(file)
48  package = slash.join(pathList[:2])
49  packageResult.append((slash.join(pathList[2:]), lines))
50 
51  for file, lines in ruleResult:
52  pathList = pathToList(file)
53  head = slash.join(pathList[:2])
54  tail = slash.join(pathList[2:])
55  if package == head:
56  packageResult.append((tail, lines))
57  else:
58  info.append((package, packageResult))
59  packageResult = []
60  package = head
61  packageResult.append((tail, lines))
62  info.append((package, packageResult))
63  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(), CommissioningHistograms.extractHistograms(), DQMImplNet< DQMNet::Object >.findObject(), get_info(), dqmservices::DQMProtobufReader.load(), DQMImplNet< DQMNet::Object >.makeObject(), EcalTrigPrimESProducer.parseTextFile(), CommissioningHistograms.runNumber(), CommissioningHistograms.runType(), Measurement.Substitute2p(), and SiStripConfigDb.usingDatabase().