o
    Ni                  
   @  s  U d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl	m
Z ddl	mZ ddlmZmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) e*e+Z,e-dZ.de/d< e-dZ0de/d< d7ddZ1d8dd Z2d9d:d'd(Z3d9d:d)d*Z4ej5d+d,fej5d-d,fed.d,fe3d/d,fe4d/d,fej6d/d0fej7d/d0fej8d/d0fd1Z9d2e/d3< d;d5d6Z:dS )<zUtility functions for Sphinx.    )annotationsN)Any)ExtensionError)FiletypeNotFoundError)_files	_importerlogging)index_entries)parse_line_num_spec)
encode_uri)is_url)strip_colors)	patfilter)caption_ref_reexplicit_title_renested_parse_with_titlessplit_explicit_title)SEPcopyfile	ensuredirmake_filenameos_pathrelative_uriz\s+zre.Pattern[str]ws_rez(?P<schema>.+)://.*url_rebasedocnamestrdocnamereturnc                 C  s    t t d|  d|dd  S )N/z..   )	posixpathnormpathjoin)r   r    r$   H/home/ubuntu/.local/lib/python3.10/site-packages/sphinx/util/__init__.pydocname_join0   s    r&   source_suffixdict[str, str]filenamestr | os.PathLike[str]c                 C  s2   |   D ]\}}t||r|pd  S qt)Nrestructuredtext)itemsosfspathendswithr   )r'   r)   suffixfiletyper$   r$   r%   get_filetype4   s
   r2       databytes_kwr   hashlib._Hashc                 K     t j| ddS )zKDeprecated wrapper around hashlib.md5

    To be removed in Sphinx 9.0
    Fusedforsecurity)hashlibmd5r4   r6   r$   r$   r%   _md5>      r>   c                 K  r8   )zLDeprecated wrapper around hashlib.sha1

    To be removed in Sphinx 9.0
    Fr9   )r;   sha1r=   r$   r$   r%   _sha1F   r?   rA   z)sphinx.util.index_entries.split_index_msg)	   r   z$sphinx.util.index_entries.split_intozsphinx.errors.ExtensionError )
   r   )split_index_msg
split_intor   r<   r@   import_objectFilenameUniqDictDownloadFilesz+dict[str, tuple[Any, str, tuple[int, int]]]_DEPRECATED_OBJECTSnamec                 C  sN   | t vrdtd| }t|ddlm} t |  \}}}|t| ||d |S )Nzmodule z has no attribute r   )_deprecation_warning)remove)rJ   __name__AttributeErrorsphinx.deprecationrL   )rK   msgrL   deprecated_objectcanonical_namerM   r$   r$   r%   __getattr__c   s   rT   )r   r   r   r   r   r   )r'   r(   r)   r*   r   r   )r3   )r4   r5   r6   r   r   r7   )rK   r   r   r   );__doc__
__future__r   r;   r-   r!   retypingr   sphinx.errorsr   _ExtensionErrorr   sphinx.utilr   r   r   r	   _index_entriessphinx.util._linesr
   parselinenossphinx.util._urir   r   isurlsphinx.util.consoler   sphinx.util.matchingr   sphinx.util.nodesr   r   r   r   sphinx.util.osutilr   r   r   r   r   r   	getLoggerrN   loggercompiler   __annotations__r   r&   r2   r>   rA   rE   rG   rH   rI   rJ   rT   r$   r$   r$   r%   <module>   sR     	
	





