
    Yf                        d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	 d dl
mZ eej                     Z G d d      Z G d	 d
e      Zy)    )annotationsN)AnyList)
processors)Frame)Sessionc                  V    e Zd ZU dZdZded<   	 dZded<   	 d Zdd	Z G d
 de	      Z
y)Rendererz,
    Abstract base class for renderers.
    txtstroutput_file_extensionFbooloutput_is_binaryc                     y )N selfs    [/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/pyinstrument/renderers/base.py__init__zRenderer.__init__   s        c                    t               zM
        Return a string that contains the rendered form of `frame`.
        NotImplementedErrorr   sessions     r   renderzRenderer.render"        "##r   c                      e Zd Zy)Renderer.MisconfigurationErrorN)__name__
__module____qualname__r   r   r   MisconfigurationErrorr    (   s    r   r$   Nr   r   returnr   )r!   r"   r#   __doc__r   __annotations__r   r   r   	Exceptionr$   r   r   r   r
   r
      sA     "'3& #d"$	 r   r
   c                  p    e Zd ZU dZded<   	 ded<   	 ded<   ded<   	 	 	 d	 	 	 	 	 dd
ZddZddZddZy	)FrameRendererz
    An abstract base class for renderers that process Frame objects using
    processor functions. Provides a common interface to manipulate the
    processors before rendering.
    ProcessorListr   zdict[str, Any]processor_optionsr   show_alltimelineNc                0   | j                         | _        |xs i | _        || _        || _        |rt        j
                  t        j                  t        j                  t        j                  fD ]?  }t        j                  t              5  | j                  j                  |       ddd       A |rLt        j                  t              5  | j                  j                  t        j                         ddd       yy# 1 sw Y   xY w# 1 sw Y   yxY w)a  
        :param show_all: Don't hide library frames - show everything that pyinstrument captures.
        :param timeline: Instead of aggregating time, leave the samples in chronological order.
        :param processor_options: A dictionary of processor options.
        N)default_processorsr   r-   r.   r/   group_library_frames_processorremove_importlibremove_irrelevant_nodesremove_tracebackhide
contextlibsuppress
ValueErrorremoveaggregate_repeated_calls)r   r.   r/   r-   ps        r   r   zFrameRenderer.__init__B   s     113!2!8b  99++22//	
 .  ((4 .OO**1-. .. $$Z0 L&&z'J'JKL L 	. .
L Ls   D *D D		Dc                    t               )zQ
        Return a list of processors that this renderer uses by default.
        r   r   s    r   r1   z FrameRenderer.default_processorsi   r   r   c                T    |}| j                   D ]  } ||| j                        } |S )N)options)r   r-   )r   
root_frameframe	processors       r   
preprocesszFrameRenderer.preprocesso   s3     	EIeT-C-CDE	Er   c                    t               r   r   r   s     r   r   zFrameRenderer.renderu   r   r   )FFN)r.   r   r/   r   r-   zdict[str, Any] | None)r&   r,   )r?   Frame | Noner&   rD   r%   )	r!   r"   r#   r'   r(   r   r1   rB   r   r   r   r   r+   r+   ,   sm      &% NN 37	%L%L %L 1	%LN$$r   r+   )
__future__r   r6   typingr   r   pyinstrumentr   pyinstrument.framer   pyinstrument.sessionr   ProcessorTyper,   r
   r+   r   r   r   <module>rK      sA    "   # $ (
 Z--. 8M$H M$r   