a qqe@slddlZddlmZddlmZddlmZmZddlm Z ddl m Z ddl m Z Gd d d eee ZdS) N)Iterable)CriteriaDescriptor) MatchAlias MatchName) Sensitivity) PolicyQuery) match_levelcs\eZdZUdZeddZdZeed<dZ eed<ddfd d Z e e dd d Z ZS) SensitivityQuerya Query MLS Sensitivities 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. sens The criteria to match the sensitivity by dominance. sens_dom If true, the criteria will match if it dominates the sensitivity. sens_domby If true, the criteria will match if it is dominated by the sensitivity. Zlookup_sensitivity)Zlookup_functionFsens_dom sens_dombyN)returnc s(tt|j|fi|tt|_dS)N)superr __init__loggingZ getLogger__name__log)selfpolicykwargs __class__>/usr/lib64/python3.9/site-packages/setools/sensitivityquery.pyr)szSensitivityQuery.__init__ccs|jd|||j||j|jd||jD]\}||sVqF| |sbqF|j r|j r||j |krqFn |j r|j |krqFn |j |krqF|VqFdS)z2Generator which yields all matching sensitivities.z.Generating sensitivity results from {0.policy}z:Sens: {0.sens!r}, dom: {0.sens_dom}, domby: {0.sens_domby}N) rinfoformatZ_match_name_debugZ_match_alias_debugdebugrZ sensitivitiesZ _match_nameZ _match_aliassensr r )rsrrrresults-s&       zSensitivityQuery.results)r __module__ __qualname____doc__rrr bool__annotations__r rrrr __classcell__rrrrr s    r )rtypingrZ descriptorsrZmixinsrrZ policyreprqueryrutilr r rrrrs