a qéqe_ã@sTddlZddlmZddlmZmZddlmZddlm Z Gdd„deee ƒZ dS) éN)ÚIterableé)Ú MatchAliasÚ MatchName)ÚCategory)Ú PolicyQuerycs8eZdZdZddœ‡fdd„ Zeedœdd„Z‡ZS)Ú CategoryQuerya¯ Query MLS Categories Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the category to match. name_regex If true, regular expression matching will be used for matching the name. alias The alias name to match. alias_regex If true, regular expression matching will be used on the alias names. N)Úreturnc s(tt|ƒj|fi|¤Žt t¡|_dS)N)ÚsuperrÚ__init__ÚloggingZ getLoggerÚ__name__Úlog)ÚselfÚpolicyÚkwargs©Ú __class__©ú;/usr/lib64/python3.9/site-packages/setools/categoryquery.pyr szCategoryQuery.__init__ccs\|j d |¡¡| |j¡| |j¡|j ¡D]"}| |¡sDq4| |¡sPq4|Vq4dS)z/Generator which yields all matching categories.z+Generating category results from {0.policy}N) rÚinfoÚformatZ_match_name_debugZ_match_alias_debugrÚ categoriesZ _match_nameZ _match_alias)rÚcatrrrÚresults"s    zCategoryQuery.results) r Ú __module__Ú __qualname__Ú__doc__r rrrÚ __classcell__rrrrr sr) r ÚtypingrZmixinsrrZ policyreprÚqueryrrrrrrÚs