CMS 3D CMS Logo

Public Member Functions | Private Attributes

csvSelectionParser::csvSelectionParser Class Reference

List of all members.

Public Member Functions

def __init__
def numls
def numruns
def runs
def runsandls
def runsandlsStr

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.

00010                                :
00011         self.__result={}
00012         self.__strresult={}
00013         self.__filename=filename
00014         csvReader=csv.reader(open(filename),delimiter=',')
00015         for row in csvReader:
00016             field0=str(row[0]).strip()
00017             try:
00018                 field1=str(row[1]).strip()
00019             except Exception,e:
00020                 field1='1' # for list with run number only, fake lsnum
00021             if not is_intstr(field0) or not  is_intstr(field1):
00022                 continue
00023             runnumber=int(field0)
00024             lsnumber=int(field1)
00025             if self.__result.has_key(runnumber):
00026                 self.__result[runnumber].append(lsnumber)
00027             else:
00028                 self.__result[runnumber]=[lsnumber]            
00029         for k,lsvalues in self.__result.items():
00030             lsvalues.sort()
            self.__strresult[k]=[str(x) for x in lsvalues]

Member Function Documentation

def csvSelectionParser::csvSelectionParser::numls (   self,
  run 
)

Definition at line 43 of file csvSelectionParser.py.

00044                        :
00045         return len(self.__result[run])
        
def csvSelectionParser::csvSelectionParser::numruns (   self)

Definition at line 41 of file csvSelectionParser.py.

00042                      :
        return len(self.__result.keys())
def csvSelectionParser::csvSelectionParser::runs (   self)

Definition at line 31 of file csvSelectionParser.py.

00032                   :
        return self.__result.keys()
def csvSelectionParser::csvSelectionParser::runsandls (   self)
return {run:lslist}

Definition at line 33 of file csvSelectionParser.py.

00034                        :
00035         '''return {run:lslist}
00036         '''
        return self.__result
def csvSelectionParser::csvSelectionParser::runsandlsStr (   self)
return {'run':lslist}

Definition at line 37 of file csvSelectionParser.py.

00038                           :
00039         '''return {'run':lslist}
00040         '''
        return self.__strresult

Member Data Documentation

Definition at line 9 of file csvSelectionParser.py.

Definition at line 9 of file csvSelectionParser.py.

Definition at line 9 of file csvSelectionParser.py.