o
    UÌh9  ã                   @  s>   d dl mZ d dlZd dlmZ d dlmZ G dd„ dƒZdS )é    )ÚannotationsN)ÚFrame)ÚFrameCollectionc                   @  sf   e Zd Z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S )Ú	InspectorÚ	exceptionÚBaseExceptionc                 C  s$   || _ d | _d | _d | _|j| _d S ©N)Ú
_exceptionÚ_framesÚ_outer_framesÚ_inner_framesÚ__context__Ú_previous_exception)Úselfr   © r   úg/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/crashtest/inspector.pyÚ__init__
   s
   zInspector.__init__Úreturnc                 C  ó   | j S r   )r	   ©r   r   r   r   r      ó   zInspector.exceptionÚstrc                 C  s
   | j jjS r   )r	   Ú	__class__Ú__name__r   r   r   r   Úexception_name   ó   
zInspector.exception_namec                 C  s
   t | jƒS r   )r   r	   r   r   r   r   Úexception_message   r   zInspector.exception_messager   c                 C  s^   | j d ur| j S tƒ | _ | jj}|r,t |¡}| j  ttj|j	g|¢R Ž ƒ¡ |j
}|s| j S r   )r
   r   r	   Ú__traceback__ÚinspectÚgetframeinfoÚappendr   Ú	FrameInfoÚtb_frameÚtb_next)r   ÚtbÚ
frame_infor   r   r   Úframes   s   

 ýzInspector.framesúBaseException | Nonec                 C  r   r   ©r   r   r   r   r   Úprevious_exception-   r   zInspector.previous_exceptionÚboolc                 C  s
   | j d uS r   r(   r   r   r   r   Úhas_previous_exception1   s   
z Inspector.has_previous_exceptionN)r   r   )r   r   )r   r   )r   r   )r   r'   )r   r*   )r   Ú
__module__Ú__qualname__r   Úpropertyr   r   r   r&   r)   r+   r   r   r   r   r   	   s    
r   )Ú
__future__r   r   Úcrashtest.framer   Úcrashtest.frame_collectionr   r   r   r   r   r   Ú<module>   s
    