3 sz'DeviceMatcher.match..cs g|]}|kr|ddqS)Nr )rr)positive_rulesr r r sr*FT) isinstancestrresplitlenappendfnmatch)selfrulesZ device_nameZnegative_rulesZmatchesrr )r r matchs         zDeviceMatcher.matchcCs,g}x"|D]}|j||r |j|q W|S)z Match a device list against the specification in the profile. Returns the list, which is a subset of devices which match. )rr)rrZ device_listZmatching_devicesZdevicer r r match_list,s   zDeviceMatcher.match_listN)__name__ __module__ __qualname____doc__rrr r r r rs)rr__all__objectrr r r r s