
    Ri7                    &   d Z ddlmZ ddlZddlZddlmZmZmZm	Z	 ddl
mZmZ ddlmZ erddl
mZ  eej$                        Z e       j(                  j*                  ZdZej0                  d	k(  r G d
 de	      Zn G d de      Z G d d      Zy)a+  What follows is awful and will be gone in Sphinx 10.

Instances of _StrPath should not be constructed except in Sphinx itself.
Consumers of Sphinx APIs should prefer using ``pathlib.Path`` objects
where possible. _StrPath objects can be treated as equivalent to ``Path``,
save that ``_StrPath.replace`` is overridden with ``str.replace``.

To continue treating path-like objects as strings, use ``os.fspath``,
or explicit string coercion.

In Sphinx 10, ``Path`` objects will be expected and returned in all instances
that ``_StrPath`` is currently used.
    )annotationsN)Path	PosixPathPurePathWindowsPath)TYPE_CHECKINGoverload)RemovedInSphinx10Warning)AnyziSphinx 10 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.win32c                  ~     e Zd Z	 d	 	 	 	 	 	 	 ddZddZddZddZddZddZd fdZ	d fdZ
dd	Zdd
Z xZS )_StrPathc                   t        j                  t        t        d       | j	                         j                  |||      S N   
stacklevelwarningswarn_MSGr
   __str__replaceselfoldnewcounts       L/home/agent/.friday_env/lib/python3.12/site-packages/sphinx/util/_pathlib.pyr   z_StrPath.replace)   0    
 MM$ 8QG<<>))#sE::    c                    |t         v r:t        j                  t        t        d       t        | j                         |      S t        d|}t        |      Nr   r   z has no attribute 	_STR_METHODSr   r   r   r
   getattrr   
_PATH_NAMEAttributeErrorr   itemmsgs      r   __getattr__z_StrPath.__getattr__1   J    |#d$<Kt||~t44N"4TH=C %%r!   c                h    t        j                  t        t        d       | j	                         |z   S r   r   r   r   r
   r   r   others     r   __add__z_StrPath.__add__8   $    MM$ 8QG<<>E))r!   c                h    t        j                  t        t        d       || j	                         z   S r   r/   r0   s     r   __radd__z_StrPath.__radd__<   $    MM$ 8QG4<<>))r!   c                f    | j                         s!t        j                  t        t        d       yyNr   r   FTr   r   r   r   r
   r   s    r   __bool__z_StrPath.__bool__@   "    <<>d$<Kr!   c                f    t        j                  t        t        d       || j	                         v S r   r/   r   r*   s     r   __contains__z_StrPath.__contains__F   $    MM$ 8QG4<<>))r!   c                    t        |t              rt        |   |      S t        |t              r3t        j                  t        t        d       | j                         |k(  S t        S r   
isinstancer   super__eq__strr   r   r   r
   r   NotImplementedr   r1   	__class__s     r   rE   z_StrPath.__eq__J   N    %*w~e,,%%d$<K||~..!!r!   c                     t         |          S NrD   __hash__r   rI   s    r   rN   z_StrPath.__hash__R       7#%%r!   c                h    t        j                  t        t        d       | j	                         |   S r   r/   r>   s     r   __getitem__z_StrPath.__getitem__U   $    MM$ 8QG<<>$''r!   c                t    t        j                  t        t        d       t	        | j                               S r   r   r   r   r
   lenr   r:   s    r   __len__z_StrPath.__len__Y   $    MM$ 8QGt||~&&r!   r   rF   r   rF   r   intreturnrF   r*   rF   r]   r   r1   rF   r]   rF   r]   boolr*   rF   r]   ra   r1   objectr]   ra   r]   r\   r*   zint | slicer]   rF   __name__
__module____qualname__r   r,   r2   r5   r;   r?   rE   rN   rR   rW   __classcell__rI   s   @r   r   r   (   X    35	;	;!$	;-0	;	;	&	*	*		*	"	&	(	'r!   r   c                  ~     e Zd Z	 d	 	 	 	 	 	 	 ddZddZddZddZddZddZd fdZ	d fdZ
dd	Zdd
Z xZS )r   c                   t        j                  t        t        d       | j	                         j                  |||      S r   r   r   s       r   r   z_StrPath.replace`   r    r!   c                    |t         v r:t        j                  t        t        d       t        | j                         |      S t        d|}t        |      r#   r$   r)   s      r   r,   z_StrPath.__getattr__h   r-   r!   c                h    t        j                  t        t        d       | j	                         |z   S r   r/   r0   s     r   r2   z_StrPath.__add__o   r3   r!   c                h    t        j                  t        t        d       || j	                         z   S r   r/   r0   s     r   r5   z_StrPath.__radd__s   r6   r!   c                f    | j                         s!t        j                  t        t        d       yyr8   r9   r:   s    r   r;   z_StrPath.__bool__w   r<   r!   c                f    t        j                  t        t        d       || j	                         v S r   r/   r>   s     r   r?   z_StrPath.__contains__}   r@   r!   c                    t        |t              rt        |   |      S t        |t              r3t        j                  t        t        d       | j                         |k(  S t        S r   rB   rH   s     r   rE   z_StrPath.__eq__   rJ   r!   c                     t         |          S rL   rM   rO   s    r   rN   z_StrPath.__hash__   rP   r!   c                h    t        j                  t        t        d       | j	                         |   S r   r/   r>   s     r   rR   z_StrPath.__getitem__   rS   r!   c                t    t        j                  t        t        d       t	        | j                               S r   rU   r:   s    r   rW   z_StrPath.__len__   rX   r!   rY   r[   r^   r_   r`   rb   rc   re   rf   rg   rl   s   @r   r   r   _   rm   r!   c                  f    e Zd Zd	dZd
dZedd       Zedd       Z	 d	 	 	 	 	 ddZddZddZy)_StrPathPropertyc                    d| _         y )N instance_attrr:   s    r   __init__z_StrPathProperty.__init__   s
    "$r!   c                    d| | _         y )N_r}   )r   ownernames      r   __set_name__z_StrPathProperty.__set_name__   s     Zr!   c                     y rL    r   objobjtypes      r   __get__z_StrPathProperty.__get__   s    EHr!   c                     y rL   r   r   s      r   r   z_StrPathProperty.__get__   s    GJr!   Nc                Z    || S | j                   st        t        || j                         S rL   )r~   r(   r&   r   s      r   r   z_StrPathProperty.__get__   s0     ;K!!  sD..//r!   c                    	 t        || j                  t        |             y # t        $ rI}t	        |      j
                  }| j                  j                  d      }| d| d}t        |      |d }~ww xY w)Nr   .z% may only be set to path-like objects)setattrr~   r   	TypeErrortyperj   removeprefix)r   r   valueerrcls_namer   r+   s          r   __set__z_StrPathProperty.__set__   sq    	*C++Xe_= 	*Cy--H%%2237DJav%JKCC.c)		*s    # 	A5AA00A5c                0    t        || j                         y rL   )delattrr~   )r   r   s     r   
__delete__z_StrPathProperty.__delete__   s    T''(r!   )r]   None)r   rd   r   rF   r]   r   )r   r   r   r   r]   rz   )r   rd   r   ztype[object]r]   r   rL   )r   zobject | Noner   ztype[object] | Noner]   z_StrPathProperty | _StrPath)r   r   r   z_StrPath | Pathr]   r   )r   r   r]   r   )	rh   ri   rj   r   r   r	   r   r   r   r   r!   r   rz   rz      sX    %( H HJ J BF0 0+>0	$0*)r!   rz   )__doc__
__future__r   sysr   pathlibr   r   r   r   typingr   r	   sphinx.deprecationr
   r   	frozensetrF   __dict__r%   rI   rh   r'   r   platformr   rz   r   r!   r   <module>r      s    # 
  : : * 7&V&&
1  <<73'; 3'n3'9 3'l )  )r!   