Esempio n. 1
0
def getPlotInstance(dbName,
                    tag,
                    since='1',
                    fileType='png',
                    directory='./',
                    image='',
                    shortName=None):
    '''Returns Plot class instance depending on dbName parameter. Other parameters are required to create instance of Plot class'''
    #print directory
    if shortName is not None:
        dir = getDirectory(dbName=shortName,
                           tag=tag,
                           since=since,
                           fileType=fileType,
                           basedir=directory)
    else:
        dir = getDirectory(dbName=dbName,
                           tag=tag,
                           since=since,
                           fileType=fileType,
                           basedir=directory)
    #raise Exception('asdasdasdlal761523476152351263alla' + str(dir))
    if re.match(__striptag, os.path.basename(dbName)) != None:
        return StripUtils.StripPlot(dbName=dbName,
                                    tag=tag,
                                    since=since,
                                    fileType=fileType,
                                    directory=dir,
                                    png=image)
    elif re.match(__hcaltag, os.path.basename(dbName)) != None:
        return HcalUtils.HcalPlot(dbName=dbName,
                                  tag=tag,
                                  since=since,
                                  fileType=fileType,
                                  directory=dir,
                                  png=image)
    else:  # re.match(__ecaltag, os.path.basename(dbName)) != None or re.match(__rpctag, os.path.basename(dbName)) != None:
        return EcalUtils.EcalPlot(dbName=dbName,
                                  tag=tag,
                                  since=since,
                                  fileType=fileType,
                                  directory=dir)
    return EcalUtils.EcalPlot(dbName=dbName,
                              tag=tag,
                              since=since,
                              fileType=fileType,
                              directory=dir)
Esempio n. 2
0
def getDirectory(dbName, tag = '', since = '', fileType = 'png', basedir = './', default = False, shortName = None):
    if default:
        return  StaticFile.get_directory(get_formated_db_name(dbName), tag = tag, since = since, fileType = fileType, basedir = basedir)
    if re.match(__striptag, os.path.basename(dbName)) != None:
        return StripUtils.get_directory(dbName = get_formated_db_name(dbName), tag = tag, since = since, fileType = fileType, basedir = basedir) 
    elif re.match(__hcaltag, os.path.basename(dbName)) != None:
        return HcalUtils.get_directory(dbName = get_formated_db_name(dbName), tag = tag, since = since, fileType = fileType, basedir = basedir) 
    else:# re.match(__ecaltag, os.path.basename(dbName)) != None or re.match(__rpctag, os.path.basename(dbName)) != None:
        return EcalUtils.get_directory(dbName = get_formated_db_name(dbName), tag = tag, since = since, fileType = fileType, basedir = basedir) 
    return StaticFile.get_directory(get_formated_db_name(dbName), tag = tag, since = since, fileType = fileType, basedir = basedir) 
Esempio n. 3
0
def getHistoInstance(dbName, tag, since='1', fileType='png', directory='./'):
    '''Returns class, that handles histo request specific to dbName.'''
    dir = getDirectory(dbName=dbName,
                       tag=tag,
                       since=since,
                       fileType=fileType,
                       basedir=directory)
    return EcalUtils.EcalHisto(dbName=dbName,
                               tag=tag,
                               since=since,
                               fileType=fileType,
                               directory=dir)
Esempio n. 4
0
def getNames(dbName, tag, since = '1', fileType = 'png', basedir = './'):
    '''Usage: getNames(dbName, tag, since, fileType, basedir) -> []'''
    if re.match(__striptag, os.path.basename(dbName)) != None:
        return StripUtils.get_files(dbName = dbName, tag = tag, since = since, 
                                           fileType = fileType, basedir = basedir)
    elif re.match(__hcaltag, os.path.basename(dbName)) != None:
        return HcalUtils.get_files(dbName = dbName, tag = tag, since = since, 
                                           fileType = fileType, basedir = basedir)
    else:# re.match(__ecaltag, os.path.basename(dbName)) != None or re.match(__rpctag, os.path.basename(dbName)) != None:
        return EcalUtils.get_files(dbName = dbName, tag = tag, since = since, 
                                           fileType = fileType, basedir = basedir)
    return ''
Esempio n. 5
0
def getNames(dbName, tag, since='1', fileType='png', basedir='./'):
    '''Usage: getNames(dbName, tag, since, fileType, basedir) -> []'''
    if re.match(__striptag, os.path.basename(dbName)) != None:
        return StripUtils.get_files(dbName=dbName,
                                    tag=tag,
                                    since=since,
                                    fileType=fileType,
                                    basedir=basedir)
    elif re.match(__hcaltag, os.path.basename(dbName)) != None:
        return HcalUtils.get_files(dbName=dbName,
                                   tag=tag,
                                   since=since,
                                   fileType=fileType,
                                   basedir=basedir)
    else:  # re.match(__ecaltag, os.path.basename(dbName)) != None or re.match(__rpctag, os.path.basename(dbName)) != None:
        return EcalUtils.get_files(dbName=dbName,
                                   tag=tag,
                                   since=since,
                                   fileType=fileType,
                                   basedir=basedir)
    return ''
Esempio n. 6
0
def getDirectory(dbName,
                 tag='',
                 since='',
                 fileType='png',
                 basedir='./',
                 default=False,
                 shortName=None):
    if default:
        return StaticFile.get_directory(get_formated_db_name(dbName),
                                        tag=tag,
                                        since=since,
                                        fileType=fileType,
                                        basedir=basedir)
    if re.match(__striptag, os.path.basename(dbName)) != None:
        return StripUtils.get_directory(dbName=get_formated_db_name(dbName),
                                        tag=tag,
                                        since=since,
                                        fileType=fileType,
                                        basedir=basedir)
    elif re.match(__hcaltag, os.path.basename(dbName)) != None:
        return HcalUtils.get_directory(dbName=get_formated_db_name(dbName),
                                       tag=tag,
                                       since=since,
                                       fileType=fileType,
                                       basedir=basedir)
    else:  # re.match(__ecaltag, os.path.basename(dbName)) != None or re.match(__rpctag, os.path.basename(dbName)) != None:
        return EcalUtils.get_directory(dbName=get_formated_db_name(dbName),
                                       tag=tag,
                                       since=since,
                                       fileType=fileType,
                                       basedir=basedir)
    return StaticFile.get_directory(get_formated_db_name(dbName),
                                    tag=tag,
                                    since=since,
                                    fileType=fileType,
                                    basedir=basedir)