509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
í«„^_  ã               @   sb   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	 ddl
mZmZ G dd	„ d	ee	ƒZdS )
é    Né   )ÚCriteriaDescriptorÚCriteriaSetDescriptor)ÚMatchObjClass)ÚMLSRuletype)ÚPolicyQuery)Úmatch_indirect_regexÚmatch_rangec                   s~   e Zd ZdZeed�ZeddƒZdZ	dZ
eddƒZdZdZedd	ƒZdZed
d�ZdZdZdZdZ‡ fdd„Zdd„ Z‡  ZS )ÚMLSRuleQueryaÛ  
    Query MLS rules.

    Parameter:
    policy            The policy to query.

    Keyword Parameters/Class attributes:
    ruletype         The list of rule type(s) to match.
    source           The name of the source type/attribute to match.
    source_regex     If true, regular expression matching will
                     be used on the source type/attribute.
    target           The name of the target type/attribute to match.
    target_regex     If true, regular expression matching will
                     be used on the target type/attribute.
    tclass           The object class(es) to match.
    tclass_regex     If true, use a regular expression for
                     matching the rule's object class.
    )Ú
enum_classÚsource_regexZlookup_type_or_attrFTÚtarget_regexÚtclass_regexZlookup_classZlookup_range)Zlookup_functionc                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/mlsrulequery.pyr   @   s    zMLSRuleQuery.__init__c             c   s  | j jdj| ƒƒ | j jdj| ƒƒ | j jdj| ƒƒ | j jdj| ƒƒ | j| j ƒ | j jdj| ƒƒ x¢| jjƒ D ]”}| jrŠ|j| jkrŠqr| jrªt	|j| j| j
| jƒ rªqr| jrÊt	|j| j| j| jƒ rÊqr| j|ƒsÖqr| joút|j| j| j| j| j| jƒ �r qr|V  qrW dS )z.Generator which yields all matching MLS rules.z+Generating MLS rule results from {0.policy}zRuletypes: {0.ruletype}zLSource: {0.source!r}, indirect: {0.source_indirect}, regex: {0.source_regex}zLTarget: {0.target!r}, indirect: {0.target_indirect}, regex: {0.target_regex}zŒDefault: {0.default!r}, overlap: {0.default_overlap}, subset: {0.default_subset}, superset: {0.default_superset}, proper: {0.default_proper}N)r   ÚinfoÚformatÚdebugZ_match_object_class_debugr   ZmlsrulesÚruletypeÚsourcer   Úsource_indirectr   ÚtargetÚtarget_indirectr   Z_match_object_classÚdefaultr	   Údefault_subsetÚdefault_overlapÚdefault_supersetÚdefault_proper)r   Zruler   r   r   ÚresultsD   sH    





zMLSRuleQuery.results)r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r    r   r!   Ztclassr   r"   r$   r#   r%   r&   r   r'   Ú__classcell__r   r   )r   r   r
      s"   




r
   )r   Zdescriptorsr   r   Zmixinsr   Z	policyrepr   Zqueryr   Úutilr   r	   r
   r   r   r   r   Ú<module>   s   