'Get the first component item with these flags
@param flags: dictionary of flags'

def get_first(self, **flags):

    for item in self.components:
        if ((not flags) or all([(getattr(item, f) == flags[f]) for f in flags])):
            return item
    return None
