+
    ,i%  c                   s   R t ^ RIt^ RIHtHt ^ RIHt ^ RIHtH	t	 ^ RI
t
^RIHtHt ]
P                  ! R4      t ! R R]
P                   ],          4      t ! R	 R
]]],          ,          4      t ! R R]]],          ,          4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R4      tR# )z
SETools descriptors.

These classes override how a class's attributes are get/set/deleted.
This is how the @property decorator works.

See https://docs.python.org/3/howto/descriptor.html
for more details.
N)ABCabstractmethod)defaultdict)Callable
Collection)	policyreputilTc                   st   a  ] tR t^"t o RtRV 3R lR lltV 3R lR ltRV 3R lR lltV 3R	 lR
 ltRt	V t
R# )CriteriaDescriptoraF  
Single item criteria descriptor.

Keyword Parameters:
name_regex      The name of instance's regex setting attribute;
                used as name_regex below.  If unset,
                regular expressions will never be used.
lookup_function The name of the SELinuxPolicy lookup function,
                e.g. lookup_type or lookup_boolean.
default_value   The default value of the criteria.  The default
                is None.
enum_class      The class of enumeration which supports a
                lookup class method.

Read-only instance attribute use (obj parameter):
policy          The instance of SELinuxPolicy
name_regex      This attribute is read to determine if
                the criteria should be looked up or
                compiled into a regex.  If the attribute
                does not exist, False is assumed.
Nc                s   < V ^8  d   QhRS[ R,          RS[S[ ,          R,          RS[S[P                  ,          R,          RR/# )   
name_regexNlookup_function
enum_classreturn)strr   Ztyper   Z
PolicyEnumZformat__classdict__   ":/usr/lib64/python3.14/site-packages/setools/descriptors.py__annotate__CriteriaDescriptor.__annotate__:   sI      3: "*S.4"715i6J6J1Kd1R^b    c                s:    Wn         W0n        W n        W@n        V  R # N)regexdefault_valuer   r   )selfr
   r   r   r   s   &&&&&r   __init__ZCriteriaDescriptor.__init__:   s     ",
*6E$r   c                s$   < V ^8  d   QhRS[ RR/# )r	   namer   Nr   r   r   r   r   r   H   s     ( ( ( (r   c                s    R V 2V n         R# )Z
_internal_Nr   r   Zownerr      &&&r   __set_name__ZCriteriaDescriptor.__set_name__H   s     '	r   c                    < V ^8  d   QhRS[ /# )r	   r   )r   r   r   r   r   r   K   s     ; ;A ;r   c                sV    Vf   \         h\        WP                  V P                  4      # r   )AttributeErrorgetattrr   r   r   objZobjtyper   r   __get__ZCriteriaDescriptor.__get__K   s$    ;  sIIt'9'9::r   c                   < V ^8  d   QhRR/# r	   r   N r   r   r   r   r   Q   s     + +T +r   c                s   V'       g#   \        WP                  V P                  4       R# V P                  '       dI   \	        WP                  R 4      '       d-   \        WP                  \
        P                  ! V4      4       R# V P                  '       dg   \        V P                  4      '       d   V P                  pM \	        VP                  V P                  4      p\        WP                  V! V4      4       R# V P                  '       d2   \        WP                  V P                  P                  V4      4       R# \        WP                  V4       R# )FN)setattrr   r   r   r#   recompiler   callablepolicyr   lookupr   r%   valuer/      &&& r   __set__ZCriteriaDescriptor.__set__Q   s    CD$6$67ZZZGCU;;CBJJu$56!!!,,---- T-A-ABCF5M2___CDOO$:$:5$ABCE*r   )r   r   r   r   r   )NNNNr   )__name__
__module____qualname____firstlineno____doc__r   r    r&   r3   __static_attributes____classdictcell__r      @r   r   r   "   s2     , ( (; ;+ +r   r   c                   s*   a  ] tR t^bt o RtR tRtV tR# )CriteriaSetDescriptorz!Descriptor for a set of criteria.c                s  a a V'       g$   \        VS P                  S P                  4       R# S P                  '       dK   \	        VS P                  R 4      '       d.   \        VS P                  \
        P                  ! V4      4       R# S P                  '       du   \        S P                  4      '       d   S P                  oM \	        VP                  S P                  4      o\        VS P                  \        V3R lV 4       4      4       R# S P                  '       d-   \        VS P                  \        V 3R lV 4       4      4       R# \        VS P                  \        V4      4       R# )Fc              3   s4   <"   T F  pS! V4      x  K  	  R # 5ir   r)   ).0vr/      & r   	<genexpr>0CriteriaSetDescriptor.__set__.<locals>.<genexpr>p   s     -GAfQiis   c              3   sZ   <"   T F   pSP                   P                  V4      x  K"  	  R # 5ir   )r   r/   )r>   r?   r   r@   r   rA   rB   r   s%     -WQVAdoo.D.DQ.G.GQVs   (+N)r*   r   r   r   r#   r+   r,   r   r-   r.   	frozensetr   r0   s   f&&@r   r3   ZCriteriaSetDescriptor.__set__f   s    CD$6$67ZZZGCU;;CBJJu$56!!!,,---- T-A-ABCI-G-G$GH___CI-WQV-W$WXCIe$45r   r)   N)r4   r5   r6   r7   r8   r3   r9   r:   r;   r<   r   r=   r=   b   s     +6 6r   r=   c                   sL   a  ] tR t^wt o RtRV 3R lR lltV 3R lR ltRtV tR# )	CriteriaPermissionSetDescriptoraf  
Descriptor for a set of permissions criteria.

name_regex      The name of instance's regex setting attribute;
                used as name_regex below.  If unset,
                regular expressions will never be used.
default_value   The default value of the criteria.  The default
                is None.

Read-only instance attribute use (obj parameter):
policy          The instance of SELinuxPolicy
tclass          If it exists, it will be used to validate the
                permissions.  See validate_perms_any()
tclass_regex    If tclass is a regex, the above permission validation
                will not use tclass: permissions are verified to be in
                at least one class in the policy but not verified that the
                permissions are in classes that the regex matches.  Assumes False
                if the attribute doesn't exist.
Nc                2   < V ^8  d   QhRS[ R,          RR/# )r	   r
   Nr   r   r   r   r   r   ,CriteriaPermissionSetDescriptor.__annotate__   s     + +3: +T +r   c                s    Wn         W n        R # r   )r   r   )r   r
   r   r   r   r   Z(CriteriaPermissionSetDescriptor.__init__   s    
*r   c                r'   r(   r)   r   r   r   r   rF      s     + +T +r   c                s>   V'       g#   \        WP                  V P                  4       R# V P                  '       dI   \	        WP                  R 4      '       d-   \        WP                  \
        P                  ! V4      4       R# \        R V 4       4      p\	        VRR 4      '       d   RpM\	        VRR4      pV'       d#   \        V\        4      '       g   \        V34      p\        P                  ! VVVP                  R7       \        WP                  V4       R# )Fc              3   s$   "   T F  qx  K  	  R # 5ir   r)   )r>   r?   s   & r   rA   Z:CriteriaPermissionSetDescriptor.__set__.<locals>.<genexpr>   s     /Aas   Ztclass_regexNtclass)rG   r.   )r*   r   r   r   r#   r+   r,   rC   Z
isinstancer   r   Zvalidate_perms_anyr.   )r   r%   r1   ZpermsrG   s   &&&  r   r3   Z'CriteriaPermissionSetDescriptor.__set__   s    CD$6$67ZZZGCU;;CBJJu$56///EsNE22 h5j<<"F9-##E+1+.::7 CE*r   )r   r   )NN)	r4   r5   r6   r7   r8   r   r3   r9   r:   r;   r<   r   rD   rD   w   s     (+ ++ +r   rD   c                   sj   a  ] tR t^t o RtR
V 3R lR lltR tR
R lt]R 4       t	]R 4       t
R	tV tR# )NetworkXGraphEdgeDescriptora  
Descriptor abstract base class for NetworkX graph edge attributes.

Keyword Parameter:
name        Override the graph edge property name.

Instance class attribute use (obj parameter):
G           The NetworkX graph
source      The edge's source node
target      The edge's target node
Nc                rE   )r	   propnameNr   r   r   r   r   r   Z(NetworkXGraphEdgeDescriptor.__annotate__   s      t t r   c                    Wn         V  R # r   )override_name)r   rI      &&r   r   Z$NetworkXGraphEdgeDescriptor.__init__   s    %r   c                s^    V P                   '       d   V P                   V n        R # TV n        R # r   )rK   r   r   r   r   r    Z(NetworkXGraphEdgeDescriptor.__set_name__   s     *.*<*<*<D&&	$	r   c                s    Vf   V #  VP                   VP                  ,          VP                  ,          V P                  ,          #   \         d    \        T P                  4      hi ; ir   )Gsourcetargetr   ZKeyErrorr"   r$   r   r   r&   Z#NetworkXGraphEdgeDescriptor.__get__   sT    ;K	,55$SZZ0;; 	, ++	,s   >A !A(c                    R # r   r)   r   r%   r1   r   r   r3   Z#NetworkXGraphEdgeDescriptor.__set__       r   c                rP   r   r)   r   r%   rL   r   
__delete__Z&NetworkXGraphEdgeDescriptor.__delete__   rR   r   )r   rK   r   )r4   r5   r6   r7   r8   r   r    r&   r   r3   rT   r9   r:   r;   r<   r   rH   rH      sG     
 G,    r   rH   c                   s0   a  ] tR t^t o RtR tR tRtV tR# )EdgeAttrDictz7A descriptor for edge attributes that are dictionaries.c                s    VfK   \        \        4      VP                  VP                  ,          VP                  ,          V P
                  &   R # \        V P
                   R24      h)Nz- dictionaries should not be assigned directly)r   ZlistrM   rN   rO   r   r"   rQ   r   r   r3   ZEdgeAttrDict.__set__   sG    =7B47HCEE#**cjj)$))4 DII;.[!\]]r   c                    VP                   VP                  ,          VP                  ,          V P                  ,          P	                  4        R # r   rM   rN   rO   r   ZclearrS   rL   r   rT   ZEdgeAttrDict.__delete__   -    cjj#**%dii0668r   r)   N	r4   r5   r6   r7   r8   r3   rT   r9   r:   r;   r<   r   rU   rU      s     A^9 9r   rU   c                   s0   a  ] tR t^t o RtR tR tRtV tR# )EdgeAttrIntMaxz
A descriptor for edge attributes that are non-negative integers that always
keep the max assigned value until re-initialized.
c                s   Vf>   ^ VP                   VP                  ,          VP                  ,          V P                  &   R # VP                   VP                  ,          VP                  ,          V P                  ,          p\	        W24      VP                   VP                  ,          VP                  ,          V P                  &   R # r   )rM   rN   rO   r   Zmax)r   r%   r1   Zcurrent_valuer2   r   r3   ZEdgeAttrIntMax.__set__   sx    =78CEE#**cjj)$))4EE#**-cjj9$))DM7:=7PCEE#**cjj)$))4r   c                s|    ^ VP                   VP                  ,          VP                  ,          V P                  &   R# )i    N)rM   rN   rO   r   rS   rL   r   rT   ZEdgeAttrIntMax.__delete__   s&    34cjj#**%dii0r   r)   NrY   r;   r<   r   rZ   rZ      s     
Q5 5r   rZ   c                   s0   a  ] tR t^t o RtR tR tRtV tR# )EdgeAttrListz0A descriptor for edge attributes that are lists.c                s    Vf>   . VP                   VP                  ,          VP                  ,          V P                  &   R # \	        V P                   R24      h)Nz& lists should not be assigned directly)rM   rN   rO   r   Z
ValueErrorrQ   r   r   r3   ZEdgeAttrList.__set__   sB    =79CEE#**cjj)$))4		{*PQRRr   c                rV   r   rW   rS   rL   r   rT   ZEdgeAttrList.__delete__  rX   r   r)   NrY   r;   r<   r   r[   r[      s     :S9 9r   r[   c                   sR   a  ] tR tRt o RtV 3R lR ltR tRR ltR tR	 t	R
t
V tR# )PermissionMapDescriptori  a  
Descriptor for Permission Map mappings.

Parameter:
validator   A callable for validating the setting.

Instance class attribute use (obj parameter):
_perm_map   The full permission map.
class_      The mapping's object class
perm        The mapping's permission
c                r!   )r	   	validator)r   r   r   r   r   Z$PermissionMapDescriptor.__annotate__  s      ( r   c                rJ   r   )r]   )r   r]   rL   r   r   Z PermissionMapDescriptor.__init__  s
    #,r   c                s    W n         R # r   r   r   r   r   r    Z$PermissionMapDescriptor.__set_name__  s    	r   Nc                s    Vf   V # VP                   VP                  ,          VP                  ,          V P                  ,          # r   )	_perm_mapclass_permr   r$   r   r   r&   ZPermissionMapDescriptor.__get__   s1    ;K}}SZZ(2499==r   c                s    V P                  V4      VP                  VP                  ,          VP                  ,          V P                  &   R # r   )r]   r^   r_   r`   r   rQ   r   r   r3   ZPermissionMapDescriptor.__set__&  s/    9=9Ncjj!#((+DII6r   c                s    \         hr   )r"   rS   rL   r   rT   Z"PermissionMapDescriptor.__delete__)  s    r   )r   r]   r   )r4   r5   r6   r7   r8   r   r    r&   r3   rT   r9   r:   r;   r<   r   r\   r\     s.     
 >O r   r\   )r8   r+   Zabcr    r   Zcollectionsr   Zcollections.abcr   r   ZtypingZ r   r   ZTypeVarr   ZGenericr   Zsetr=   r   rD   rH   rU   rZ   r[   r\   r)   r   r   <module>ra      s    
 # # 0  
NN3=+* =+@6.s1v6 6*.+&8S&B .+r$# $N9. 950 5&9. 9$ r   