o
    Ni!                     @  s   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 ddlmZ eejZe jjZdZejdkrCG d	d
 d
e	ZdS G dd
 d
eZdS )a(  What follows is awful and will be gone in Sphinx 9.

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 overriden with ``str.replace``.

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

In Sphinx 9, ``Path`` objects will be expected and returned in all instances
that ``_StrPath`` is currently used.
    )annotationsN)Path	PosixPathPurePathWindowsPath)Any)RemovedInSphinx90WarningzhSphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.win32c                      v   e Zd Z	d d!dd	Zd"ddZd#ddZd$ddZd%ddZd& fddZd' fddZ	d(ddZ
d'ddZ  ZS ))_StrPatholdstrnewcountintreturnc                C  "   t jttdd |  |||S N   
stacklevelwarningswarn_MSGr   __str__replaceselfr   r   r    r    H/home/ubuntu/.local/lib/python3.10/site-packages/sphinx/util/_pathlib.pyr   &      _StrPath.replaceitemr   c                 C  <   |t v rtjttdd t|  |S td|}t|Nr   r   z has no attribute 	_STR_METHODSr   r   r   r   getattrr   
_PATH_NAMEAttributeErrorr   r$   msgr    r    r!   __getattr__.   
   _StrPath.__getattr__otherc                 C     t jttdd |  | S r   r   r   r   r   r   r   r1   r    r    r!   __add__5      _StrPath.__add__boolc                 C      |   stjttdd dS dS Nr   r   FTr   r   r   r   r   r   r    r    r!   __bool__9      _StrPath.__bool__c                 C     t jttdd ||  v S r   r3   r   r$   r    r    r!   __contains__?   r6   _StrPath.__contains__objectc                   @   t |trt |S t |trtjttdd | 	 |kS t
S r   
isinstancer   super__eq__r   r   r   r   r   r   NotImplementedr4   	__class__r    r!   rI   C      

_StrPath.__eq__c                   
   t   S NrH   __hash__r<   rK   r    r!   rR   K      
_StrPath.__hash__int | slicec                 C     t jttdd |  | S r   r3   rA   r    r    r!   __getitem__N   r6   _StrPath.__getitem__c                 C     t jttdd t|  S r   r   r   r   r   lenr   r<   r    r    r!   __len__R   r6   _StrPath.__len__r   r   r   r   r   r   r   r   r   r$   r   r   r   r1   r   r   r   r   r8   r$   r   r   r8   r1   rD   r   r8   r   r   r$   rU   r   r   __name__
__module____qualname__r   r.   r5   r=   rB   rI   rR   rW   r\   __classcell__r    r    rK   r!   r   %       




r   c                      r
   ))r   r   r   r   r   r   r   r   c                C  r   r   r   r   r    r    r!   r   Y   r"   r#   r$   r   c                 C  r%   r&   r'   r,   r    r    r!   r.   a   r/   r0   r1   c                 C  r2   r   r3   r4   r    r    r!   r5   h   r6   r7   r8   c                 C  r9   r:   r;   r<   r    r    r!   r=   l   r>   r?   c                 C  r@   r   r3   rA   r    r    r!   rB   r   r6   rC   rD   c                   rE   r   rF   r4   rK   r    r!   rI   v   rM   rN   c                   rO   rP   rQ   r<   rK   r    r!   rR   ~   rS   rT   rU   c                 C  rV   r   r3   rA   r    r    r!   rW      r6   rX   c                 C  rY   r   rZ   r<   r    r    r!   r\      r6   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   r    r    rK   r!   r   X   rl   )__doc__
__future__r   sysr   pathlibr   r   r   r   typingr   sphinx.deprecationr   	frozensetr   __dict__r(   rL   rh   r*   r   platformr   r    r    r    r!   <module>   s    


3