def load_configuration_from_text_file(register, configuration_file):
logging.info("<STR_LIT>" % configuration_file)<EOL>register.configuration_file = configuration_file<EOL>config_dict = parse_global_config(register.configuration_file)<EOL>if '<STR_LIT>' in config_dict:<EOL><INDENT>flavor = config_dict.pop('<STR_LIT>').lower()<EOL>if register.flavor:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>register.init_fe_type(flavor)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if register.flavor:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>if '<STR_LIT>' in config_dict:<EOL><INDENT>chip_id = config_dict.pop('<STR_LIT>')<EOL>if register.chip_address:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>register.set_chip_address(chip_address=chip_id & <NUM_LIT>, broadcast=True if chip_id & <NUM_LIT> else False)<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in config_dict:<EOL><INDENT>chip_address = config_dict.pop('<STR_LIT>')<EOL>if register.chip_address:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>register.set_chip_address(chip_address)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if register.chip_id_initialized:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>global_registers_configured = []<EOL>pixel_registers_configured = []<EOL>for key in config_dict.keys():<EOL><INDENT>value = config_dict.pop(key)<EOL>if key in register.global_registers:<EOL><INDENT>register.set_global_register_value(key, value)<EOL>global_registers_configured.append(key)<EOL><DEDENT>elif key in register.pixel_registers:<EOL><INDENT>register.set_pixel_register_value(key, value)<EOL>pixel_registers_configured.append(key)<EOL><DEDENT>elif key in register.calibration_parameters:<EOL><INDENT>register.calibration_parameters[key] = value<EOL><DEDENT>else:<EOL><INDENT>register.miscellaneous[key] = value<EOL><DEDENT><DEDENT>global_registers = register.get_global_register_attributes('<STR_LIT:name>', readonly=False)<EOL>pixel_registers = register.pixel_registers.keys()<EOL>global_registers_not_configured = set(global_registers).difference(global_registers_configured)<EOL>pixel_registers_not_configured = set(pixel_registers).difference(pixel_registers_configured)<EOL>if global_registers_not_configured:<EOL><INDENT>logging.warning("<STR_LIT>".format('<STR_LIT:U+002CU+0020>'.join('<STR_LIT>' + reg + '<STR_LIT>' for reg in global_registers_not_configured)))<EOL><DEDENT>if pixel_registers_not_configured:<EOL><INDENT>logging.warning("<STR_LIT>".format('<STR_LIT:U+002CU+0020>'.join('<STR_LIT>' + reg + '<STR_LIT>' for reg in pixel_registers_not_configured)))<EOL><DEDENT>if register.miscellaneous:<EOL><INDENT>logging.warning("<STR_LIT>".format('<STR_LIT:U+002CU+0020>'.join('<STR_LIT>' + parameter + '<STR_LIT>' for parameter in register.miscellaneous.iterkeys())))<EOL><DEDENT>
Loading configuration from text files to register object

    Parameters
    ----------
    register : pybar.fei4.register object
    configuration_file : string
        Full path (directory and filename) of the configuration file. If name is not given, reload configuration from file.