CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
csvSelectionParser.csvSelectionParser Class Reference
Inheritance diagram for csvSelectionParser.csvSelectionParser:

Public Member Functions

def __init__ (self, filename)
 
def numls (self, run)
 
def numruns (self)
 
def runs (self)
 
def runsandls (self)
 
def runsandlsStr (self)
 

Private Attributes

 __filename
 
 __result
 
 __strresult
 

Detailed Description

Definition at line 9 of file csvSelectionParser.py.

Constructor & Destructor Documentation

def csvSelectionParser.csvSelectionParser.__init__ (   self,
  filename 
)

Definition at line 10 of file csvSelectionParser.py.

10  def __init__(self,filename):
11  self.__result={}
12  self.__strresult={}
13  self.__filename=filename
14  csvReader=csv.reader(open(filename),delimiter=',')
15  for row in csvReader:
16  field0=str(row[0]).strip()
17  try:
18  field1=str(row[1]).strip()
19  except Exception as e:
20  field1='1' # for list with run number only, fake lsnum
21  if not is_intstr(field0) or not is_intstr(field1):
22  continue
23  runnumber=int(field0)
24  lsnumber=int(field1)
25  if runnumber in self.__result:
26  self.__result[runnumber].append(lsnumber)
27  else:
28  self.__result[runnumber]=[lsnumber]
29  for k,lsvalues in self.__result.items():
30  lsvalues.sort()
31  self.__strresult[k]=[str(x) for x in lsvalues]
#define str(s)

Member Function Documentation

def csvSelectionParser.csvSelectionParser.numls (   self,
  run 
)
def csvSelectionParser.csvSelectionParser.numruns (   self)
def csvSelectionParser.csvSelectionParser.runs (   self)
def csvSelectionParser.csvSelectionParser.runsandls (   self)
def csvSelectionParser.csvSelectionParser.runsandlsStr (   self)
return {'run':lslist}

Definition at line 38 of file csvSelectionParser.py.

References csvSelectionParser.csvSelectionParser.__strresult, and csvLumibyLSParser.csvLumibyLSParser.__strresult.

38  def runsandlsStr(self):
39  '''return {'run':lslist}
40  '''
41  return self.__strresult

Member Data Documentation

csvSelectionParser.csvSelectionParser.__filename
private

Definition at line 13 of file csvSelectionParser.py.

csvSelectionParser.csvSelectionParser.__result
private
csvSelectionParser.csvSelectionParser.__strresult
private