def process_sourcelist(self, sources):
    sources = listify(sources)
    added_sources = {}
    for s in sources:
        if hasattr(s, 'held_object'):
            s = s.held_object
        if isinstance(s, File):
            if (s not in added_sources):
                self.sources.append(s)
                added_sources[s] = True
        elif isinstance(s, (GeneratedList, CustomTarget, CustomTargetIndex)):
            self.generated.append(s)
        else:
            msg = 'Bad source of type {!r} in target {!r}.'.format(type(s).__name__, self.name)
            raise InvalidArguments(msg)
def process_sourcelist(self, sources):
    sources = listify(sources)
    added_sources = {}
    for s in sources:
        if hasattr(s, 'held_object'):
            s = s.held_object
        if isinstance(s, File):
            if (s not in added_sources):
                self.sources.append(s)
                added_sources[s] = True
        elif isinstance(s, (GeneratedList, CustomTarget, CustomTargetIndex)):
            self.generated.append(s)
        else:
            msg = 'Bad source of type {!r} in target {!r}.'.format(type(s).__name__, self.name)
            raise InvalidArguments(msg)