a qéqeÎã@s^ddlZddlmZmZddlmZddlmZddlm Z ddl m Z Gdd „d ee ƒZ dS) éN)ÚIterableÚOptionalé)ÚCriteriaDescriptor)Ú MatchName)ÚBoolean)Ú PolicyQuerycsteZdZUdZdZeeed<eeedœdd„ƒZ e j ddœdd„ƒZ ddœ‡fdd „ Z e e dœd d „Z‡ZS) Ú BoolQueryaœQuery SELinux policy Booleans. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The Boolean name to match. name_regex If true, regular expression matching will be used on the Boolean name. default The default state to match. If this is None, the default state not be matched. NÚ_default)ÚreturncCs|jS©N)r )Úself©rú7/usr/lib64/python3.9/site-packages/setools/boolquery.pyÚdefaultszBoolQuery.defaultcCs|durd|_n t|ƒ|_dSr )r Úbool)r Úvaluerrrr#sc s(tt|ƒj|fi|¤Žt t¡|_dSr )Úsuperr Ú__init__ÚloggingZ getLoggerÚ__name__Úlog)r ÚpolicyÚkwargs©Ú __class__rrr*szBoolQuery.__init__ccsn|j d |¡¡| |j¡|j d |¡¡|j ¡D].}| |¡sJq:|jdurb|j |jkrbq:|Vq:dS)z:Generator which yields all Booleans matching the criteria.z*Generating Boolean results from {0.policy}zDefault: {0.default}N) rÚinfoÚformatZ_match_name_debugÚdebugrZboolsZ _match_namerÚstate)r ZbooleanrrrÚresults.s  zBoolQuery.results)rÚ __module__Ú __qualname__Ú__doc__r rrÚ__annotations__ÚpropertyrÚsetterrrrr Ú __classcell__rrrrr s  r ) rÚtypingrrZ descriptorsrZmixinsrZ policyreprÚqueryrr rrrrÚs