当前位置: 首页>>代码示例>>Python>>正文


Python config.add_configuration函数代码示例

本文整理汇总了Python中mi.logging.config.add_configuration函数的典型用法代码示例。如果您正苦于以下问题:Python add_configuration函数的具体用法?Python add_configuration怎么用?Python add_configuration使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_configuration函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.dosta_abcdjm_mmp_cds',
        DataSetDriverConfigKeys.PARTICLE_CLASS: 'DostaAbcdjmMmpCdsParserDataParticle'
    }
    
    def exception_callback(exception):
        log.debug("ERROR: " + exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
            
    with open(sourceFilePath, 'rb') as stream_handle:
        parser = DostaAbcdjmMmpCdsParser(parser_config,
                                         None,
                                         stream_handle,
                                         lambda state, ingested: None,
                                         lambda data: None,
                                         exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()    
        
    return particleDataHdlrObj
开发者ID:chrisfortin,项目名称:mi-dataset,代码行数:25,代码来源:dosta_abcdjm_mmp_cds_recovered_driver.py

示例2: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.phsen_abcdef',
        DataSetDriverConfigKeys.PARTICLE_CLASS: ['PhsenRecoveredMetadataDataParticle',
                                                 'PhsenRecoveredInstrumentDataParticle']
    }

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
    
    with open(sourceFilePath, 'rb') as stream_handle:
        parser = PhsenRecoveredParser(parser_config,
                                      None,
                                      stream_handle,
                                      lambda state, ingested: None,
                                      lambda data: None,
                                      exception_callback)
        
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()    

        
    return particleDataHdlrObj
开发者ID:tapanagupta,项目名称:mi-dataset,代码行数:27,代码来源:phsen_abcdef_recovered_driver.py

示例3: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    driver = PresfAbcDclDriver(sourceFilePath, particleDataHdlrObj, DataTypeKey.PRESF_ABC_DCL_TELEMETERED)

    return driver.process()
开发者ID:chrisfortin,项目名称:mi-dataset,代码行数:7,代码来源:presf_abc_dcl_telemetered_driver.py

示例4: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.adcps_jln_stc',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None,
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            AdcpsJlnStcParticleClassKey.METADATA_PARTICLE_CLASS:
                AdcpsJlnStcMetadataRecoveredDataParticle,
            AdcpsJlnStcParticleClassKey.INSTRUMENT_PARTICLE_CLASS:
                AdcpsJlnStcInstrumentRecoveredDataParticle,
        }
    }
    log.debug("My ADCPS JLN STC Config: %s", config)

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpsJlnStcParser(config,
                                   None,
                                   file_handle,
                                   lambda state, ingested: None,
                                   lambda data: None,
                                   exception_callback)
                
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()  
        
    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:34,代码来源:adcps_jln_stc_recovered_driver.py

示例5: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            'velocity': 'VelocityEarth',
            'engineering': 'AdcpsEngineering',
            'config': 'AdcpsConfig',
            'bottom_track': 'EarthBottom',
            'bottom_track_config': 'BottomConfig',
        }
    }
    log.trace("My ADCPS JLN Config: %s", config)

    def exception_callback(exception):
        log.error("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpPd0Parser(config, file_handle, exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()

    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:28,代码来源:adcps_jln_driver.py

示例6: init

    def init(self, debug=False):
        """Initialize logging for MI.  Because this is a singleton it will only be initialized once."""
        path = os.environ[LOGGING_CONFIG_ENVIRONMENT_VARIABLE] if LOGGING_CONFIG_ENVIRONMENT_VARIABLE in os.environ else None
        haveenv = path and os.path.isfile(path)
        if path and not haveenv:
            print >> os.stderr, 'WARNING: %s was set but %s was not found (using default configuration files instead)' % (LOGGING_CONFIG_ENVIRONMENT_VARIABLE, path)
        if path and haveenv:
            config.replace_configuration(path)
            if debug:
                print >> sys.stderr, str(os.getpid()) + ' configured logging from ' + path
        elif os.path.isfile(LOGGING_PRIMARY_FROM_FILE):
            config.replace_configuration(LOGGING_PRIMARY_FROM_FILE)
            if debug:
                print >> sys.stderr, str(os.getpid()) + ' configured logging from ' + LOGGING_PRIMARY_FROM_FILE
        else:
            logconfig = pkg_resources.resource_string('mi', LOGGING_PRIMARY_FROM_EGG)
            parsed = yaml.load(logconfig)
            config.replace_configuration(parsed)
            if debug:
                print >> sys.stderr, str(os.getpid()) + ' configured logging from config/' + LOGGING_PRIMARY_FROM_FILE

        if os.path.isfile(LOGGING_MI_OVERRIDE):
            config.add_configuration(LOGGING_MI_OVERRIDE)
            if debug:
                print >> sys.stderr, str(os.getpid()) + ' supplemented logging from ' + LOGGING_MI_OVERRIDE
        elif os.path.isfile(LOGGING_CONTAINER_OVERRIDE):
            config.add_configuration(LOGGING_CONTAINER_OVERRIDE)
            if debug:
                print >> sys.stderr, str(os.getpid()) + ' supplemented logging from ' + LOGGING_CONTAINER_OVERRIDE
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:29,代码来源:log.py

示例7: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()
    
    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.nutnr_b_particles',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None
    }

    def exception_callback(exception):
        log.debug("ERROR: " + exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
    
    with open(sourceFilePath, 'r') as stream_handle:
        parser = NutnrBDclConcRecoveredParser(parser_config,
                                              stream_handle,
                                              lambda state, ingested : None,
                                              lambda data : None,
                                              exception_callback)
        
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()    

        
    return particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:27,代码来源:nutnr_b_dcl_conc_recovered_driver.py

示例8: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.flord_l_wfp',
        DataSetDriverConfigKeys.PARTICLE_CLASS: 'FlordLWfpInstrumentParserDataParticle'
    }

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'r') as stream_handle:
        parser = GlobalWfpEFileParser(parser_config, None,
                                      stream_handle,
                                      lambda state, ingested: None,
                                      lambda data: log.trace("Found data: %s", data),
                                      exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()

    return particleDataHdlrObj
开发者ID:GrimJ,项目名称:mi-dataset,代码行数:26,代码来源:flord_l_wfp_recovered_driver.py

示例9: __init__

    def __init__(self, basePythonCodePath, stream_handle, particleDataHdlrObj):

        #configure the mi logger
        config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
        parser = self._build_parser(stream_handle)

        super(SimpleDatasetDriver, self).__init__(parser, particleDataHdlrObj)
开发者ID:JeffRoy,项目名称:mi-dataset,代码行数:7,代码来源:dataset_driver.py

示例10: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    log = get_logger()

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.vel3d_k_wfp',
        DataSetDriverConfigKeys.PARTICLE_CLASS: ['Vel3dKWfpMetadataParticle',
                                                 'Vel3dKWfpInstrumentParticle',
                                                 'Vel3dKWfpStringParticle']
    }

    def exception_callback(exception):
        log.debug("ERROR: %r", exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()

    with open(sourceFilePath, 'rb') as stream_handle:
        parser = Vel3dKWfpParser(parser_config,
                                 None,
                                 stream_handle,
                                 lambda state,file : None,
                                 lambda data : None,
                                 exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream()


    return particleDataHdlrObj
开发者ID:emilyhahn,项目名称:mi-dataset,代码行数:30,代码来源:vel3d_k_wfp_recovered_driver.py

示例11: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    log = get_logger()

    config = {
            DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.adcps_jln',
            DataSetDriverConfigKeys.PARTICLE_CLASS: 'AdcpsJlnParticle'
        }
    log.trace("My ADCPS JLN Config: %s", config)

    def exception_callback(exception):
        log.debug("ERROR: " + exception)
        particleDataHdlrObj.setParticleDataCaptureFailure()
    
    with open(sourceFilePath, 'rb') as file_handle:
        parser = AdcpPd0Parser(config, None, file_handle,
            lambda state, ingested: None,
            lambda data: None, exception_callback)
        
        driver = DataSetDriver(parser, particleDataHdlrObj)
        driver.processFileStream() 
  
    return particleDataHdlrObj
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:25,代码来源:adcps_jln_driver.py

示例12: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    try:
        if basePythonCodePath is not None:
            pass
    except NameError:
        basePythonCodePath = os.curdir
    sys.path.append(basePythonCodePath)

    from mi.logging import config
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))
    
    from mi.core.log import get_logger
    log = get_logger()

    """
    Build and return the parser
    """
    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.ctdpf_ckl_wfp_particles',
        DataSetDriverConfigKeys.PARTICLE_CLASS: None,
        DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
            'instrument_data_particle_class': CtdpfCklWfpTelemeteredDataParticle,
            'metadata_particle_class': CtdpfCklWfpTelemeteredMetadataParticle
        }
    }
    log.debug("My Config: %s", config)
    driver = CtdpfCklWfpDriver(sourceFilePath, particleDataHdlrObj, config)
        
    return driver.process()
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:30,代码来源:ctdpf_ckl_wfp_telemetered_driver.py

示例13: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    from mi.logging import config

    config.add_configuration(os.path.join(basePythonCodePath, "res", "config", "mi-logging.yml"))

    from mi.core.log import get_logger

    log = get_logger()

    from mi.dataset.dataset_driver import DataSetDriver, ParticleDataHandler

    from mi.dataset.parser.parad_k_stc_imodem import Parad_k_stc_imodemParser
    from mi.dataset.dataset_parser import DataSetDriverConfigKeys

    config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: "mi.dataset.parser.parad_k_stc_imodem",
        DataSetDriverConfigKeys.PARTICLE_CLASS: "Parad_k_stc_imodemDataParticle",
    }

    try:
        if particleDataHdlrObj is not None:
            pass
    except NameError:
        particleDataHdlrObj = ParticleDataHandler()

    try:
        if sourceFilePath is not None:
            pass
    except NameError:
        try:
            sourceFilePath = sys.argv[1]
        except IndexError:
            print "Need a source file path"
            sys.exit(1)

    def state_callback(state, ingested):
        pass

    def pub_callback(data):
        log.trace("Found data: %s", data)

    def exception_callback(exception):
        particleDataHdlrObj.setParticleDataCaptureFailure()

    stream_handle = open(sourceFilePath, "rb")

    try:
        parser = Parad_k_stc_imodemParser(config, None, stream_handle, state_callback, pub_callback, exception_callback)

        driver = DataSetDriver(parser, particleDataHdlrObj)

        driver.processFileStream()

    finally:
        stream_handle.close()

    stream_handle = open(sourceFilePath, "rb")
    return particleDataHdlrObj
开发者ID:jamundson,项目名称:mi-dataset,代码行数:58,代码来源:parad_k_stc_imodem_driver.py

示例14: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: "mi.dataset.parser.spkir_abj_dcl",
        DataSetDriverConfigKeys.PARTICLE_CLASS: None
    }

    driver = SpkirAbjDclTelemeteredDriver(sourceFilePath, particleDataHdlrObj, parser_config)

    return driver.process()
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:11,代码来源:spkir_abj_dcl_telemetered_driver.py

示例15: parse

def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):

    config.add_configuration(os.path.join(basePythonCodePath, 'res', 'config', 'mi-logging.yml'))

    parser_config = {
        DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.glider',
        DataSetDriverConfigKeys.PARTICLE_CLASS: 'FlortTelemeteredDataParticle'
    }

    driver = FlortMDriver(basePythonCodePath, sourceFilePath, particleDataHdlrObj, parser_config)
    return driver.process()
开发者ID:NickAlmonte,项目名称:mi-dataset,代码行数:11,代码来源:flort_m_glider_telemetered_driver.py


注:本文中的mi.logging.config.add_configuration函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。