
    iY                     D   S r SrSSKrSSKJrJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJr  / SQr\" 5       r\" 5       r \R3                  \R4                  5         " S S\5      rSS	 jrSS
 jrSS jr SS jr!g! \ a    \R3                  \R8                  5         NCf = f)a>  
Extended attributes extend the basic attributes of files and directories
in the file system.  They are stored as name:data pairs associated with
file system objects (files, directories, symlinks, etc).

The xattr type wraps a path or file descriptor with a dict-like interface
that exposes these extended attributes.
z1.3.0    N   )XATTR_NOFOLLOWXATTR_CREATEXATTR_REPLACEXATTR_NOSECURITYXATTR_MAXNAMELENXATTR_FINDERINFO_NAMEXATTR_RESOURCEFORK_NAMEXATTR_COMPAT_USER_PREFIX	_getxattr
_fgetxattr	_setxattr
_fsetxattr_removexattr_fremovexattr
_listxattr_flistxattr)r   r   r   r   r   r	   r
   xattr	listxattrgetxattrsetxattrremovexattrc                       \ rS rSrSrSS jrS rS rS\S.S jjr	SS jr
SS	 jrSS
 jrS rS rS rS rS r\rS r\rS rS rS rSS jrS rS rS rS rS rSrg)r   $   zh
A wrapper for paths or file descriptors to access
their extended attributes with a dict-like interface
c                 b    Xl         X l        [        USS5      nUb  U" 5       U l        gXl        g)z
obj should be a path, a file descriptor, or an
object that implements fileno() and returns a file
descriptor.

options should be 0 or XATTR_NOFOLLOW.  If set, it will
be OR'ed with the options passed to getxattr, setxattr, etc.
filenoN)objoptionsgetattrvalue)selfr   r   r   s       ;/app/mltbenv/lib/python3.13/site-packages/xattr/__init__.py__init__xattr.__init__*   s0     h-DJJ    c                     [        U R                  [        5      (       a  SnOSnS[        U 5      R                  < SU< SU R                  < S3$ )Nfdfile< =>)
isinstancer    inttype__name__)r!   flavors     r"   __repr__xattr.__repr__;   s9    djj#&&FF#Dz22FDJJGGr%   c                     [        U R                  [        5      (       a  U" U R                  /UQ76 $ U" U R                  /UQ76 $ N)r-   r    r.   )r!   	name_funcfd_funcargss       r"   _callxattr._callB   s;    djj#&&4::---TZZ/$//r%   )defaultc          	           U R                  [        [        USSX R                  -  5      $ ! [         a*  nU[
        La  UR                  [        ;   a  Us SnA$ e SnAff = f)z
Retrieve the extended attribute ``name`` as a ``str``.
Raises ``IOError`` on failure unless default is provided.

See x-man-page://2/getxattr for options and possible errors.
r   N)r9   r   r   r   OSError_SENTINEL_MISSINGerrnoERRNO_MISSING)r!   namer   r;   es        r"   get	xattr.getH   sS    	::iT1a<<AWXX 	//AGG}4L	s    ), 
A AA AA c           	      T    U R                  [        [        XSX0R                  -  5      $ )z
Set the extended attribute ``name`` to ``value``
Raises ``IOError`` on failure.

See x-man-page://2/setxattr for options and possible errors.
r   )r9   r   r   r   )r!   rA   r    r   s       r"   set	xattr.setV   s"     zz)Za<<AWXXr%   c                 R    U R                  [        [        XU R                  -  5      $ )z
Remove the extended attribute ``name``
Raises ``IOError`` on failure.

See x-man-page://2/removexattr for options and possible errors.
)r9   r   r   r   )r!   rA   r   s      r"   removexattr.remove_   s      zz,tt||=STTr%   c                     U R                  [        [        XR                  -  5      R	                  S5      nUR                  5         U Vs/ s H  n[        UR                  S5      -   PM     sn$ s  snf )z
Retrieves the extended attributes currently set as a list
of strings.  Raises ``IOError`` on failure.

See x-man-page://2/listxattr for options and possible errors.
    zutf-8)r9   r   r   r   splitpopr   decode)r!   r   resss       r"   list
xattr.listh   sY     jj['LL2HIOOPWX	FIJc(188G+<<cJJJs   "A0c                 4    [        U R                  5       5      $ r5   )lenrR   r!   s    r"   __len__xattr.__len__u   s    499;r%   c                 Z     U R                  U5        g ! [         a    [        U5      ef = fr5   )rI   IOErrorKeyErrorr!   items     r"   __delitem__xattr.__delitem__x   s,    	!KK 	!4. 	!s    *c                 &    U R                  X5        g r5   )rF   )r!   r]   r    s      r"   __setitem__xattr.__setitem__~   s    r%   c                 X     U R                  U5      $ ! [         a    [        U5      ef = fr5   )rC   rZ   r[   r\   s     r"   __getitem__xattr.__getitem__   s.    	!88D>! 	!4. 	!s    )c                 4    [        U R                  5       5      $ r5   )iterrR   rV   s    r"   iterkeysxattr.iterkeys   s    DIIK  r%   c                 H     U R                  U5        g! [         a     gf = f)NTFrC   rZ   r\   s     r"   has_keyxattr.has_key   s+    	HHTN   		s    
!!c                 6    U R                  5        H  nX	 M     g r5   )keysr!   ks     r"   clearxattr.clear   s    A r%   c                 v    [        US5      (       d  [        U5      nUR                  5        H	  u  p#X0U'   M     g )Nitems)hasattrdictru   )r!   seqrq   vs       r"   updatexattr.update   s1    sG$$s)CIIKDAG  r%   c                 4    [        U R                  5       5      $ r5   )rw   	iteritemsrV   s    r"   copy
xattr.copy       DNN$%%r%   c                 T     U R                  U5      nU$ ! [         a    X U'    U$ f = fr5   rk   )r!   rq   ds      r"   
setdefaultxattr.setdefault   s8    	A   	G	s    ''c                 "    U R                  5       $ r5   )rR   rV   s    r"   ro   
xattr.keys   s    yy{r%   c              #   F   #    U R                  5        H	  u  pUv   M     g 7fr5   )r}   )r!   rq   ry   s      r"   
itervaluesxattr.itervalues   s     NN$DAG %s   !c                 4    [        U R                  5       5      $ r5   )rR   r   rV   s    r"   valuesxattr.values   s    DOO%&&r%   c              #   b   #    U R                  5        H  nXR                  U5      4v   M     g 7fr5   )rR   rC   rp   s     r"   r}   xattr.iteritems   s%     AXXa[.  s   -/c                 4    [        U R                  5       5      $ r5   )rR   r}   rV   s    r"   ru   xattr.items   r   r%   )r   r   r    N)r   ) )r0   
__module____qualname____firstlineno____doc__r#   r2   r9   r>   rC   rF   rI   rR   rW   r^   ra   rd   rh   __iter__rl   __contains__rr   rz   r~   r   ro   r   r   r}   ru   __static_attributes__ r%   r"   r   r   $   s    
"H0.? YU	K !!! H L&'!&r%   r   c                 p    [        [        U 5      R                  U=(       a    [        =(       d    SS95      $ Nr   r   )tupler   rR   r   )fsymlinks     r"   r   r      s&    qw'A>'FQGHHr%   c                 ^    [        U 5      R                  X=(       a    [        =(       d    SS9$ r   )r   rC   r   )r   attrr   s      r"   r   r      s!    8<<&@.&EA<FFr%   c                 T    U(       a	  U[         -  n[        U 5      R                  XUS9$ )Nr   )r   r   rF   )r   r   r    r   r   s        r"   r   r      s&    >!8<<W<55r%   c                 b    U=(       a    [         =(       d    Sn[        U 5      R                  XS9$ r   )r   r   rI   )r   r   r   r   s       r"   r   r      s&    (.-AG8??4?11r%   )F)r   F)"r   __version__r?   libr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   __all__objectr>   rF   r@   addENOATTRAttributeErrorENODATAr   r   r   r   r   r   r%   r"   <module>r      s     : : : : : H %emm$
U&F U&pIG62U  %emm$%s    A; ;!BB