a
    xd                     @   s|   d dl mZ erRd dlZejdkr0d dl mZ nd dlmZ G dd deddZnd d	l mZ eee	f ZG d
d dZ
dS )    )TYPE_CHECKINGN)      )	TypedDictc                   @   s&   e Zd ZU eed< eed< eed< dS )JSONTimeoutsimplicitpageLoadscriptN)__name__
__module____qualname__int__annotations__ r   r   Z/var/www/html/Ranjet/env/lib/python3.9/site-packages/selenium/webdriver/common/timeouts.pyr      s   
r   F)total)Dictc                   @   s   e Zd ZdeeeddddZeedddZejedd	d
dZeedddZejeddddZeedddZ	e	jeddddZ	ee
dddZedddZdS )Timeoutsr   N)implicit_wait	page_loadr	   returnc                 C   s(   |  || _|  || _|  || _dS )a  Create a new Timeout object.

        :Args:
         - implicit_wait - Either an int or a float. The number passed in needs to how many
            seconds the driver will wait.
         - page_load - Either an int or a float. The number passed in needs to how many
            seconds the driver will wait.
         - script - Either an int or a float. The number passed in needs to how many
            seconds the driver will wait.
        N)_convert_implicit_wait
_page_load_script)selfr   r   r	   r   r   r   __init__)   s    zTimeouts.__init__)r   c                 C   s
   | j d S )zjReturn the value for the implicit wait.

        This does not return the value on the remote end
          )r   r   r   r   r   r   8   s    zTimeouts.implicit_wait)r   r   c                 C   s   |  || _dS )zeSets the value for the implicit wait.

        This does not set the value on the remote end
        N)r   r   )r   r   r   r   r   r   @   s    c                 C   s
   | j d S )zkReturn the value for the page load wait.

        This does not return the value on the remote end
        r   )r   r   r   r   r   r   H   s    zTimeouts.page_load)r   r   c                 C   s   |  || _dS )zfSets the value for the page load wait.

        This does not set the value on the remote end
        N)r   r   )r   r   r   r   r   r   P   s    c                 C   s
   | j d S )zhReturn the value for the script wait.

        This does not return the value on the remote end
        r   )r   r   r   r   r   r	   X   s    zTimeouts.script)r   r   c                 C   s   |  || _dS )zcSets the value for the script wait.

        This does not set the value on the remote end
        N)r   r   )r   r   r   r   r   r	   `   s    )timeoutr   c                 C   s*   t |ttfrtt|d S tdd S )Nr   z&Timeouts can only be an int or a float)
isinstancer   float	TypeError)r   r   r   r   r   r   h   s    zTimeouts._convertc                 C   s8   i }| j r| j |d< | jr$| j|d< | jr4| j|d< |S )Nr   r   r	   )r   r   r   )r   Ztimeoutsr   r   r   _to_jsonm   s    


zTimeouts._to_json)r   r   r   )r
   r   r   r!   r   propertyr   setterr   r	   r   r   r   r#   r   r   r   r   r   (   s   r   )typingr   sysversion_infor   Ztyping_extensionsr   r   strr   r   r   r   r   r   <module>   s   
