a qéqeMã@s\ddlZddlZddlmZddlmZmZddlmZddl m Z Gdd„deee ƒZ dS) éN)ÚIterableé)Ú MatchNameÚMatchPermission)ÚCommon)Ú PolicyQuerycs8eZdZdZddœ‡fdd„ Zeedœdd„Z‡ZS)Ú CommonQuerya” Query common permission sets. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the common to match. name_regex If true, regular expression matching will be used for matching the name. perms The permissions to match. perms_equal If true, only commons with permission sets that are equal to the criteria will match. Otherwise, any intersection will match. perms_regex If true, regular expression matching will be used on the permission names instead of set logic. N)Úreturnc s(tt|ƒj|fi|¤Žt t¡|_dS)N)ÚsuperrÚ__init__ÚloggingZ getLoggerÚ__name__Úlog)ÚselfÚpolicyÚkwargs©Ú __class__©ú9/usr/lib64/python3.9/site-packages/setools/commonquery.pyr #szCommonQuery.__init__ccs\|j d |¡¡| |j¡| |j¡|j ¡D]"}| |¡sDq4| |¡sPq4|Vq4dS)z,Generator which yields all matching commons.z)Generating common results from {0.policy}N) rÚinfoÚformatZ_match_name_debugZ_match_perms_debugrZcommonsZ _match_nameZ _match_perms)rZcomrrrÚresults's    zCommonQuery.results) r Ú __module__Ú __qualname__Ú__doc__r rrrÚ __classcell__rrrrrsr) r ÚreÚtypingrZmixinsrrZ policyreprÚqueryrrrrrrÚs