src/dirbs/importer/importer_factory.py
def make_data_importer(import_type, input_file, config, statsd, conn, metadata_conn,
                       run_id, metrics_root, metrics_run_root, **kwargs):
    """Factory function for creating the appropriate data importer class."""
    if import_type == 'operator':
        return make_operator_data_importer(input_file, config, statsd, conn, metadata_conn,
                                           run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'gsma_tac':
        return make_gsma_data_importer(input_file, config, statsd, conn, metadata_conn,
                                       run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'stolen_list':
        return make_stolen_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'pairing_list':
        return make_pairing_list_importer(input_file, config, statsd, conn, metadata_conn,
                                          run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'registration_list':
        return make_registration_list_importer(input_file, config, statsd, conn, metadata_conn,
                                               run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'golden_list':
        return make_golden_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'barred_list':
        return make_barred_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'barred_tac_list':
        return make_barred_tac_list_importer(input_file, config, statsd, conn, metadata_conn,
                                             run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'subscribers_registration_list':
        return make_subscribers_registration_list_importer(input_file, config, statsd, conn, metadata_conn,
                                                           run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'device_association_list':
        return make_device_association_list_importer(input_file, config, statsd, conn, metadata_conn,
                                                     run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'monitoring_list':
        return make_monitoring_list_importer(input_file, config, statsd, conn, metadata_conn,
                                             run_id, metrics_root, metrics_run_root, **kwargs)
    else:
        raise NameError('No importer found for file type: {0}'.format(import_type))
Factory function for creating the appropriate data importer class.
Factory function for creating the appropriate data importer class.
Factory function for creating the appropriate data importer class .
def make_data_importer(import_type, input_file, config, statsd, conn, metadata_conn,
                       run_id, metrics_root, metrics_run_root, **kwargs):
    if import_type == 'operator':
        return make_operator_data_importer(input_file, config, statsd, conn, metadata_conn,
                                           run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'gsma_tac':
        return make_gsma_data_importer(input_file, config, statsd, conn, metadata_conn,
                                       run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'stolen_list':
        return make_stolen_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'pairing_list':
        return make_pairing_list_importer(input_file, config, statsd, conn, metadata_conn,
                                          run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'registration_list':
        return make_registration_list_importer(input_file, config, statsd, conn, metadata_conn,
                                               run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'golden_list':
        return make_golden_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'barred_list':
        return make_barred_list_importer(input_file, config, statsd, conn, metadata_conn,
                                         run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'barred_tac_list':
        return make_barred_tac_list_importer(input_file, config, statsd, conn, metadata_conn,
                                             run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'subscribers_registration_list':
        return make_subscribers_registration_list_importer(input_file, config, statsd, conn, metadata_conn,
                                                           run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'device_association_list':
        return make_device_association_list_importer(input_file, config, statsd, conn, metadata_conn,
                                                     run_id, metrics_root, metrics_run_root, **kwargs)
    elif import_type == 'monitoring_list':
        return make_monitoring_list_importer(input_file, config, statsd, conn, metadata_conn,
                                             run_id, metrics_root, metrics_run_root, **kwargs)
    else:
        raise NameError('No importer found for file type: {0}'.format(import_type))
def make_data_importer ( import_type , input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) : if import_type == 'operator' : return make_operator_data_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'gsma_tac' : return make_gsma_data_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'stolen_list' : return make_stolen_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'pairing_list' : return make_pairing_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'registration_list' : return make_registration_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'golden_list' : return make_golden_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'barred_list' : return make_barred_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'barred_tac_list' : return make_barred_tac_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'subscribers_registration_list' : return make_subscribers_registration_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'device_association_list' : return make_device_association_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) elif import_type == 'monitoring_list' : return make_monitoring_list_importer ( input_file , config , statsd , conn , metadata_conn , run_id , metrics_root , metrics_run_root , ** kwargs ) else : raise NameError ( 'No importer found for file type: {0}' . format ( import_type ) )
Factory function for creating the appropriate data importer class.
Factory function for creating the appropriate data importer class .
"""Factory function for creating the appropriate data importer class."""
import_type
input_file
config
statsd
conn
metadata_conn
run_id
metrics_root
metrics_run_root