509318396
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
3
í«„^C  ã               @   sL   d dl mZ ddlmZ ddlmZmZ eddddgƒZG d	d
„ d
eƒZdS )é    )Ú
namedtupleé   )ÚDiffResultDescriptor)Ú
DifferenceÚSymbolWrapperZmodified_commonÚadded_permsÚremoved_permsÚmatched_permsc               @   s8   e Zd ZdZedƒZedƒZedƒZdd„ Zdd„ Z	dS )ÚCommonDifferencezV
    Determine the difference in common permission sets
    between two policies.
    Údiff_commonsc             C   sš   | j jdj| ƒƒ | jdd„ | jjƒ D ƒdd„ | jjƒ D ƒƒ\| _| _}t	ƒ | _
xD|D ]<\}}| j|j|jdd�\}}}|s€|rVt|||ƒ| j
|< qVW dS )z8Generate the difference in commons between the policies.zFGenerating common differences from {0.left_policy} to {0.right_policy}c             s   s   | ]}t |ƒV  qd S )N)r   )Ú.0Úc© r   ú/usr/lib64/python3.6/commons.pyú	<genexpr>0   s    z0CommonDifference.diff_commons.<locals>.<genexpr>c             s   s   | ]}t |ƒV  qd S )N)r   )r   r   r   r   r   r   1   s    F)ZunwrapN)ÚlogÚinfoÚformatZ	_set_diffZleft_policyZcommonsZright_policyÚadded_commonsÚremoved_commonsÚdictÚmodified_commonsZpermsÚmodified_commons_record)ÚselfZmatched_commonsZleft_commonZright_commonr   r   r	   r   r   r   r   )   s     zCommonDifference.diff_commonsc             C   s"   | j jdƒ d| _d| _d| _dS )z%Reset diff results on policy changes.zResetting common differencesN)r   Údebugr   r   r   )r   r   r   r   Ú_reset_diffD   s    zCommonDifference._reset_diffN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   r
      s   r
   N)	Úcollectionsr   Zdescriptorsr   Ú
differencer   r   r   r
   r   r   r   r   Ú<module>   s   