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 8 of file csvSelectionParser.py.

Constructor & Destructor Documentation

def csvSelectionParser.csvSelectionParser.__init__ (   self,
  filename 
)

Definition at line 9 of file csvSelectionParser.py.

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

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

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

Member Data Documentation

csvSelectionParser.csvSelectionParser.__filename
private

Definition at line 12 of file csvSelectionParser.py.

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