o
    Pj                     @   sV   d dl Z d dlmZmZmZ d dlmZ d dlmZ er"d dl	m
Z
 G dd dZdS )    N)TYPE_CHECKINGOptionalUnion)Artifact)Error)Pagec                   @   sj   e Zd Zdddee ddfddZdefdd	Zdej	fd
dZ
deeej	f ddfddZdddZdS )Videopager   artifactreturnNc                 C   s*   |j | _ |j| _|| _|jj| _|| _d S N)_loop_dispatcher_fiber_page_connection	is_remote
_is_remote	_artifact)selfr	   r
    r   L/home/thesage/.local/lib/python3.10/site-packages/playwright/_impl/_video.py__init__   s
   

zVideo.__init__c                 C   s   d| j  dS )Nz<Video page=>)r   r   r   r   r   __repr__!   s   zVideo.__repr__c                    s&   | j rtd| jstd| jjS )Nz[Path is not available when using browserType.connect(). Use save_as() to save a local copy.%Video recording has not been started.)r   r   r   absolute_pathr   r   r   r   path$   s   z
Video.pathr   c                    s@   | j jjr| j jstd| jstd| j|I d H  d S )Nz?Page is not yet closed. Close the page prior to calling save_asr   )r   r   _is_sync
_is_closedr   r   save_as)r   r   r   r   r   r    -   s   zVideo.save_asc                    s    | j r| j  I d H  d S d S r   )r   deleter   r   r   r   r!   6   s   zVideo.delete)r   N)__name__
__module____qualname__r   r   r   strr   pathlibPathr   r   r    r!   r   r   r   r   r      s    		r   )r&   typingr   r   r   playwright._impl._artifactr   playwright._impl._helperr   playwright._impl._pager   r   r   r   r   r   <module>   s   