+
    ,i  c                   s   a  R t0 t ^ RIHt ^ RIHt ^ RIHt ^RIHt ^RI	H
t
 ^RIHt ^RIHtHtHt ^RIHt ]! ]4      t] ^ k ]! R	R	R
7       ! R R]4      4       tR R lt ! R R]4      tR# )i    )defaultdict)suppress)	dataclass)NoCommon)ObjClass)DiffResultDescriptor)
DifferenceDifferenceResultSymbolWrapper)SymbolCacheT)ZfrozenZorderc                   s0   a  ] tR t^t o RtV 3R ltRtV tR# )ModifiedObjClassz/Difference details for a modified object class.c                sz   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   # )   class_added_permsremoved_permsmatched_perms)r   ZsetZstrformat__classdict__   "</usr/lib64/python3.14/site-packages/setools/diff/objclass.py__annotate__ZModifiedObjClass.__annotate__   sE     
   S  s8  s8      N)__name__
__module____qualname____firstlineno____doc__Z__annotate_func____static_attributes____classdictcell__r      @r   r
   r
      s      :  r   r
   c                sF    V ^8  d   QhR\         R\        \         ,          /# )r   r   return)r   r   r      "r   r   r      s      ( }X/F r   c                s     \         V P                  ,          V ,          #   \         d+    \        T 4      pT\         T P                  ,          T &   Tu # i ; i)zl
Wrap class from the specified policy.

This caches results to prevent duplicate wrapper
objects in memory.
)_class_cacheZpolicyZKeyErrorr   )r   c   & r   class_wrapper_factoryr'      sL    FMM*622 &!./V]]#F+s     2AAc                   s   a  ] tR t^/t o RtV 3R lR lt]],          ! ]4      t]],          ! ]4      t	]]
,          ! ]4      tV 3R lR ltRtV tR# )ObjClassDifferencezB
Determine the difference in object classes
between two policies.
c                   < V ^8  d   QhRR/# r   r!   Nr   r   r   r   r   ObjClassDifference.__annotate__6   s      N  Nd  Nr   c           	     s   V P                   P                  RV P                   RV P                   24       V P	                  R V P                  P                  4        4       R V P                  P                  4        4       4      w  V n        V n        p\        \        ,          ! 4       V n
        V F  w  r#VP                  p\        \        4      ;_uu_ 4        WBP                  P                  ,          pRRR4       VP                  p\        \        4      ;_uu_ 4        WSP                  P                  ,          pRRR4       V P	                  VVRR7      w  rgpV'       g   V'       g   K  V P                  P                  \        VVVV4      4       K  	  R#   + '       g   i     L; i  + '       g   i     Ly; i)z?Generate the difference in object classes between the policies.z"Generating class differences from z to c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr   Z.0r%   r&   r   	<genexpr>2ObjClassDifference.diff_classes.<locals>.<genexpr>=   s     B'A!]1'A   c              3   r,   r-   r.   r/   r&   r   r0   r1   >   s     C'B!]1'Br2   NF)Zunwrap)logZinfoZleft_policyZright_policyZ	_set_diffZclassesadded_classesremoved_classesZlistr
   modified_classesZpermsr   r   ZcommonZappend)	selfZmatched_classesZ
left_classZright_classZ
left_permsZright_permsr   r   r   s	   &        r   diff_classesZObjClassDifference.diff_classes6   sl    	01A1A0B$tGXGXFYZ	\ EINNBt'7'7'?'?'ABCt'8'8'@'@'BCEEAD0/ !%%5 6 8'6#J $))J(##//555
 $ &++K(##11777 $ 9=zGRNS 9G 9U5K mm%%,,-=j>I>K>K.M N# (7
 $# $#s   F!F/F,/F?c                r)   r*   r   r   r   r   r   r+   _   s     " "T "r   c                sH    V P                   P                  R4       V =V =V =R# )z%Reset diff results on policy changes.z"Resetting object class differencesN)r3   Zdebugr4   r5   r6   )r7   s   &r   _reset_diffZObjClassDifference._reset_diff_   s%    ;< !r   )r4   r6   r5   N)r   r   r   r   r   r8   r   r   r4   r5   r
   r6   r9   r   r   r   r    r   r(   r(   /   sR     
 N  ND )2<@M*84\BO+,<=lK
" "r   r(   c                sV    V ^8  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )r   r$   )__conditional_annotations__r	   r   r"   r#   r   r   r      s     # # 8 7k(# 7 $r   N)r:   Zcollectionsr    Z
contextlibr   Zdataclassesr   Z	exceptionr   Z	policyrepr   Zdescriptorsr   Z
differencer   r   r   Ztypingr	   Zdictr$   r
   r'   r(   r   )r:   r    r   <module>r;      sg    $ #  !     - C C &1$&7 7 $d#'  $ 5" 5"r   