def read_channel_list_file(*source):
<EOL>config = configparser.ConfigParser(dict_type=OrderedDict)<EOL>source = file_list(source)<EOL>success_ = config.read(*source)<EOL>if len(success_) != len(source):<EOL><INDENT>raise IOError("<STR_LIT>")<EOL><DEDENT>out = ChannelList()<EOL>out.source = source<EOL>append = out.append<EOL>for group in config.sections():<EOL><INDENT>params = OrderedDict(config.items(group))<EOL>channels = params.pop('<STR_LIT>').strip('<STR_LIT:\n>').split('<STR_LIT:\n>')<EOL>if '<STR_LIT>' in params or '<STR_LIT>' in params:<EOL><INDENT>low = params.pop('<STR_LIT>', <NUM_LIT:0>)<EOL>high = params.pop('<STR_LIT>', inf)<EOL>if isinstance(high, string_types) and high.lower() == '<STR_LIT>':<EOL><INDENT>high = inf<EOL><DEDENT>frange = float(low), float(high)<EOL><DEDENT>else:<EOL><INDENT>frange = None<EOL><DEDENT>for channel in channels:<EOL><INDENT>try:<EOL><INDENT>match = CHANNEL_DEFINITION.match(channel).groupdict()<EOL><DEDENT>except AttributeError as exc:<EOL><INDENT>exc.args = ('<STR_LIT>' % channel,)<EOL>raise<EOL><DEDENT>match = dict((k, v) for k, v in match.items() if v is not None)<EOL>match.setdefault('<STR_LIT>', '<STR_LIT>')<EOL>match.setdefault('<STR_LIT>', '<STR_LIT>')<EOL>safe = match.get('<STR_LIT>', '<STR_LIT>').lower() != '<STR_LIT>'<EOL>channel = Channel(match.pop('<STR_LIT:name>'), frequency_range=frange,<EOL>safe=safe, sample_rate=match.pop('<STR_LIT>'))<EOL>channel.params = params.copy()<EOL>channel.params.update(match)<EOL>channel.group = group<EOL>for key in ['<STR_LIT>']:<EOL><INDENT>setattr(channel, key, channel.params.pop(key, None))<EOL><DEDENT>append(channel)<EOL><DEDENT><DEDENT>return out<EOL>
Read a `~gwpy.detector.ChannelList` from a Channel List File