a qéqe—ã@sPddlmZmZddlmZddlmZmZGdd„deƒZGdd„deƒZ d S) é)Ú NamedTupleÚSeté)ÚDiffResultDescriptor)Ú DifferenceÚ SymbolWrapperc@s6eZdZUdZeeed<eeed<eeed<dS)ÚModifiedCommonz8Difference details for a modified common permission set.Ú added_permsÚ removed_permsÚ matched_permsN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚstrÚ__annotations__©rrú:/usr/lib64/python3.9/site-packages/setools/diff/commons.pyr s   rc@sDeZdZdZedƒZedƒZedƒZddœdd„Zddœdd„Z dS) ÚCommonDifferencezV Determine the difference in common permission sets between two policies. Ú diff_commonsN)ÚreturncCs–|j d |¡¡| dd„|j ¡Dƒdd„|j ¡Dƒ¡\|_|_}t ƒ|_ |D]<\}}|j|j |j dd�\}}}|s~|rTt |||ƒ|j |<qTdS)z8Generate the difference in commons between the policies.zFGenerating common differences from {0.left_policy} to {0.right_policy}css|]}t|ƒVqdS©N©r©Ú.0ÚcrrrÚ &óz0CommonDifference.diff_commons..css|]}t|ƒVqdSrrrrrrr'rF)ÚunwrapN) ÚlogÚinfoÚformatZ _set_diffZ left_policyZcommonsZ right_policyÚ added_commonsÚremoved_commonsÚdictÚmodified_commonsZpermsr)ÚselfZmatched_commonsZ left_commonZ right_commonr r r rrrrs$ÿþ þ þzCommonDifference.diff_commonscCs"|j d¡d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting common differencesN)rÚdebugr"r#r%)r&rrrÚ _reset_diff:s zCommonDifference._reset_diff) r r rrrr"r#r%rr(rrrrrs rN) ÚtypingrrZ descriptorsrÚ differencerrrrrrrrÚs