o
    Uh                     @  sB   d dl mZ d dlmZ erd dlZd dlmZ G dd dZdS )    )annotations)TYPE_CHECKINGN)	FrameTypec                   @  s   e Zd ZU i Zded< d"ddZed#d
dZed$ddZed%ddZ	ed%ddZ
ed%ddZed%ddZd$ddZd&ddZd%dd Zd!S )'Framezdict[str, str]_content_cache
frame_infoinspect.FrameInforeturnNonec                 C  s6   |j | _|| _|j| _|j| _|j| _d | _	d | _
d S N)frame_frame_frame_infolineno_linenofilename	_filenamefunction	_function_lines_file_content)selfr    r   c/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/crashtest/frame.py__init__   s   
zFrame.__init__r   c                 C     | j S r   )r   r   r   r   r   r         zFrame.frameintc                 C  r   r   )r   r   r   r   r   r      r   zFrame.linenostrc                 C  r   r   )r   r   r   r   r   r       r   zFrame.filenamec                 C  r   r   )r   r   r   r   r   r   $   r   zFrame.functionc                 C  s   | j jsdS | j jd S )N r   )r   code_contextr   r   r   r   line(   s   z
Frame.linec                 C  s   | j d u rL| jsd}n>| j| jjvrBzt| jdd}| }W d    n1 s)w   Y  W n ty:   d}Y nw || jj| j< | jj| j }|| _ | j S )Nr    zutf-8)encoding)r   r   	__class__r   openreadOSError)r   file_contentfr   r   r   r(   /   s    

zFrame.file_contentc                 C  s   t | jt | jA t | jA S r   )hashr   r   r   r   r   r   r   __hash__D      zFrame.__hash__otherobjectboolc                 C  s2   t |tst| j|jko| j|jko| j|jkS r   )	
isinstancer   NotImplementedErrorr   r   r   r   r   r   )r   r-   r   r   r   __eq__G   s   


zFrame.__eq__c                 C  s   d| j  d| j d| j dS )Nz<Frame z, >)r   r   r   r   r   r   r   __repr__P   r,   zFrame.__repr__N)r   r   r	   r
   )r	   r   )r	   r   )r	   r   )r-   r.   r	   r/   )__name__
__module____qualname__r   __annotations__r   propertyr   r   r   r   r"   r(   r+   r2   r4   r   r   r   r   r      s$   
 
	

	r   )
__future__r   typingr   inspecttypesr   r   r   r   r   r   <module>   s    