509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
í«„^  ã               @   sv   d dl Z d dlZd dlmZ ddlmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ G d	d
„ d
e
eƒZdS )é    N)Úsuppressé   )ÚCriteriaDescriptorÚCriteriaSetDescriptor)ÚNoCommon)Ú	MatchName)ÚPolicyQuery)Úmatch_regexÚmatch_regex_or_setc                   sJ   e Zd ZdZeddƒZdZedƒZdZ	dZ
dZ‡ fdd„Zd	d
„ Z‡  ZS )ÚObjClassQueryaO  
    Query object classes.

    Parameter:
    policy          The policy to query.

    Keyword Parameters/Class attributes:
    name            The name of the object set to match.
    name_regex      If true, regular expression matching will
                    be used for matching the name.
    common          The name of the inherited common to match.
    common_regex    If true, regular expression matching will
                    be used for matching the common 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.
                    comparison will not be used.
    perms_indirect  If false, permissions inherited from a common
                    permission set not will be evaluated.  Default
                    is true.
    Úcommon_regexZlookup_commonFÚperms_regexTc                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/objclassquery.pyr   B   s    zObjClassQuery.__init__c             c   sê   | j jdj| ƒƒ | j| j ƒ | j jdj| ƒƒ | j jdj| ƒƒ x¢| jjƒ D ]”}| j|ƒs^qN| jr”yt	|j| j| j
ƒszwNW n tk
r’   wNY nX | jrÜ|j}| jrÆttƒ� ||jjO }W dQ R X t|| j| j| jƒsÜqN|V  qNW dS )z3Generator which yields all matching object classes.z/Generating object class results from {0.policy}z-Common: {0.common!r}, regex: {0.common_regex}z[Perms: {0.perms}, regex: {0.perms_regex}, eq: {0.perms_equal}, indirect: {0.perms_indirect}N)r   ÚinfoÚformatZ_match_name_debugÚdebugr   ÚclassesZ_match_nameÚcommonr	   r   r   ÚpermsÚperms_indirectr   r
   Úperms_equalr   )r   Zclass_r   r   r   r   ÚresultsF   s:    


zObjClassQuery.results)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r    r   r   r   r!   Ú__classcell__r   r   )r   r   r      s   
r   )r   ÚreÚ
contextlibr   Zdescriptorsr   r   Z	exceptionr   Zmixinsr   Zqueryr   Úutilr	   r
   r   r   r   r   r   Ú<module>   s   