a qqe5@shddlZddlZddlmZddlmZmZddlmZm Z ddl m Z ddl m Z Gdd d e ZdS) N)Iterable)CriteriaDescriptorCriteriaSetDescriptor)BoundsBoundsRuletype) PolicyQuery) match_regexcsleZdZUdZeedZedZdZ e e d<edZ dZ e e d<ddfdd Zeedd d ZZS) BoundsQueryz Query *bounds statements. Parameter: policy The policy to query. Keyword Parameters/Class attributes: ruletype The rule type(s) to match. ) enum_class parent_regexF child_regexN)returnc s(tt|j|fi|tt|_dS)N)superr __init__loggingZ getLogger__name__log)selfpolicykwargs __class__9/usr/lib64/python3.9/site-packages/setools/boundsquery.pyr!szBoundsQuery.__init__ccs|jd||jd||jd||jd||jD]R}|jrj|j|jvrjqR|jrt|j|j|j sqR|j rt|j |j |j sqR|VqRdS)z7Generator which yields all matching *bounds statements.z)Generating bounds results from {0.policy}zRuletypes: {0.ruletype}z-Parent: {0.parent!r}, regex: {0.parent_regex}z*Child: {0.child!r}, regex: {0.child_regex}N) rinfoformatdebugrZboundsruletypeparentr r childr )rbrrrresults%s(zBoundsQuery.results)r __module__ __qualname____doc__rrrrrr bool__annotations__r r rrrr" __classcell__rrrrr s    r )rretypingrZ descriptorsrrZ policyreprrqueryrutilr r rrrrs