a
qéqe_ ã @ sT d dl Z d dlmZ ddlmZmZ ddlmZ ddlm Z G dd„ deee ƒZ
dS ) é N)ÚIterableé )Ú
MatchAliasÚ MatchName)ÚCategory)ÚPolicyQueryc s8 e Zd ZdZddœ‡ fdd„Zee dœ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( t t| ƒj|fi |¤Ž t t¡| _d S )N)Úsuperr Ú__init__ÚloggingZ getLoggerÚ__name__Úlog)ÚselfÚpolicyÚkwargs©Ú __class__© ú;/usr/lib64/python3.9/site-packages/setools/categoryquery.pyr s zCategoryQuery.__init__c c s\ | j d | ¡¡ | | j ¡ | | j ¡ | j ¡ D ]"}| |¡sDq4| |¡sPq4|V q4dS )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 Úcatr r r Úresults" s
zCategoryQuery.results) r
Ú
__module__Ú__qualname__Ú__doc__r r r r Ú
__classcell__r r r r r
s r )r Útypingr Zmixinsr r Z policyrepr Úqueryr r r r r r Ú