o
    US`c                     @   s|   d dl mZ er)d dlZejdkrd 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   M/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/timeouts.pyr      s   
 r   F)total)Dictc                	   @   s   e Zd ZddedededdfddZedefd	d
Zejdeddfdd
ZedefddZejdeddfddZedefddZ	e	jdeddfddZ	dede
fddZdefddZdS )Timeoutsr   implicit_wait	page_loadr	   returnNc                 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__c                 C   
   | j d S )zj
        Return the value for the implicit wait. This does not return the value on the remote end
          )r   r   r   r   r   r   9      
zTimeouts.implicit_waitr   c                 C      |  || _dS )ze
        Sets 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   @      c                 C   r   )zk
        Return the value for the page load wait. This does not return the value on the remote end
        r   )r   r   r   r   r   r   G   r    zTimeouts.page_loadr   c                 C   r!   )zf
        Sets 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   N   r"   c                 C   r   )zh
        Return the value for the script wait. This does not return the value on the remote end
        r   )r   r   r   r   r   r	   U   r    zTimeouts.scriptr   c                 C   r!   )zc
        Sets 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	   \   r"   timeoutc                 C   s&   t |ttfrtt|d S td)Nr   z&Timeouts can only be an int or a float)
isinstancer   float	TypeError)r   r#   r   r   r   r   c   s   zTimeouts._convertc                 C   s8   i }| j r
| j |d< | jr| j|d< | jr| j|d< |S )Nr   r   r	   )r   r   r   )r   Ztimeoutsr   r   r   _to_jsonh   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   
