
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
^f	                 @   sX   d dl Z d dlZddlmZmZ ddlmZ ddlmZ ddl	m
Z
 G dd deZdS )	    N   )CriteriaDescriptorCriteriaSetDescriptor)BoundsRuletype)PolicyQuery)match_regexc                   sJ   e Zd ZdZeedZedZdZ	edZ
dZ fddZdd	 Z  ZS )
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_regexc                s$   t t| j|f| tjt| _d S )N)superr   __init__loggingZ	getLogger__name__log)selfpolicykwargs)	__class__ #/usr/lib64/python3.6/boundsquery.pyr   .   s    zBoundsQuery.__init__c             c   s   | j jdj|  | j jdj|  | j jdj|  | j jdj|  xd| jj D ]V}| jrl|j| jkrlqT| jrt|j| j| j	 rqT| j
rt|j
| j
| j rqT|V  qTW dS )z7Generator which yields all matching *bounds statements.z)Generating bounds results from {0.policy}zRuletypes: {0.ruletype}z-Parent: {0.parent!r}, regex: {0.parent_regex}z*Child: {0.child!r}, regex: {0.child_regex}N)r   infoformatdebugr   Zboundsruletypeparentr   r
   childr   )r   br   r   r   results2   s$    

zBoundsQuery.results)r   
__module____qualname____doc__r   r   r   r   r   r
   r   r   r   r   __classcell__r   r   )r   r   r      s   

r   )r   reZdescriptorsr   r   Z	policyrepr   Zqueryr   utilr   r   r   r   r   r   <module>   s   