HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/ext/__pycache__/duration.cpython-310.pyc
o


$�a��@sdZddlmZmZddlmZddlmZddlmZm	Z	m
Z
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZe�e�ZGdd�de�Zd
eddfdd�Zd
edede
eddfdd�Zd
ede
jddfdd�Zd
ededdfdd�Z d
ede	eeffdd�Z!dS)z�
    sphinx.ext.duration
    ~~~~~~~~~~~~~~~~~~~

    Measure durations of Sphinx processing.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�datetime�	timedelta)�islice)�
itemgetter)�Any�Dict�List�cast)�nodes)�Sphinx)�Domain)�__)�loggingc@s~eZdZdZdZedeeeffdd��Z	deddfdd�Z
dd	d
�Zdeddfdd
�Zde
edeeefddfdd�ZdS)�DurationDomainz,A domain for durations of Sphinx processing.�duration�returncCs|j�di�S)N�reading_durations)�data�
setdefault��self�r�5/usr/lib/python3/dist-packages/sphinx/ext/duration.pyrsz DurationDomain.reading_durationsNcCs||j|jj<dS�N)r�env�docname)rrrrr�note_reading_duration"�z$DurationDomain.note_reading_durationcCs|j��dSr)r�clearrrrrr%szDurationDomain.clearrcCs|j�|d�dSr)r�pop)rrrrr�	clear_doc(rzDurationDomain.clear_doc�docnames�	otherdatacCs(|��D]
\}}||vr||j|<qdSr)�itemsr)rr!r"rrrrr�merge_domaindata+s

��zDurationDomain.merge_domaindata)rN)�__name__�
__module__�__qualname__�__doc__�name�propertyr�strrrrrr rr$rrrrrs
&r�apprNcCstt|j�d��}|��dS)zTInitialize DurationDomain on bootstrap.

    This clears results of last build.
    rN)r	rr�
get_domainr)r,�domainrrr�on_builder_inited1sr/r�contentcCst��|jjd<dS)z"Start to measure reading duration.�
started_atN)r�nowr�	temp_data)r,rr0rrr�on_source_read:sr4�doctreecCs:|jj�d�}t��|}tt|j�d��}|�|�dS)zRecord a reading duration.r1rN)	rr3�getrr2r	rr-r)r,r5r1rr.rrr�on_doctree_read?sr7�errorcCsztt|j�d��}t|j��td�dd�}|sdSt�	d�t�	t
d��t|d�D]\}}t�	d	|j|j
d
|�q*dS)z*Display duration ranking on current build.r�T)�key�reverseN�zH====================== slowest reading durations =======================�z
%d.%03d %si�)r	rrr-�sortedrr#r�logger�infor
r�seconds�microseconds)r,r8r.�	durationsr�drrr�on_build_finishedGs
�rEcCsF|�t�|�dt�|�dt�|�dt�|�dt�dddd�S)Nzbuilder-initedzsource-readzdoctree-readzbuild-finished�builtinT)�version�parallel_read_safe�parallel_write_safe)�
add_domainr�connectr/r4r7rE)r,rrr�setupTs
�rL)"r(rr�	itertoolsr�operatorr�typingrrrr	�docutilsr
�sphinx.applicationr�sphinx.domainsr�
sphinx.localer
�sphinx.utilr�	getLoggerr%r?rr/r+r4�documentr7�	ExceptionrErLrrrr�<module>s"