o
    é\h8
  ã                   @   s,   d dl mZ G dd„ dƒZG dd„ dƒZdS )é   )ÚCommandc                   @   s8   e Zd Zdd„ Zedd„ ƒZedd„ ƒZedd„ ƒZd	S )
Ú_ConnectionTypec                 C   s
   || _ d S )N©Úmask)Úselfr   © r   úc/home/air/segue/gemini/backup/venv/lib/python3.10/site-packages/selenium/webdriver/remote/mobile.pyÚ__init__   s   
z_ConnectionType.__init__c                 C   s   | j d dkS ©Né   r   r   ©r   r   r   r   Úairplane_mode   ó   z_ConnectionType.airplane_modec                 C   s   | j d d dkS r
   r   r   r   r   r   Úwifi   s   z_ConnectionType.wific                 C   s   | j d dkS )Né   é    r   r   r   r   r   Údata!   r   z_ConnectionType.dataN)Ú__name__Ú
__module__Ú__qualname__r	   Úpropertyr   r   r   r   r   r   r   r      s    

r   c                   @   st   e Zd ZeZedƒZedƒZedƒZedƒZdd„ Z	e
dd„ ƒZd	d
„ Ze
dd„ ƒZejddd„ƒZe
dd„ ƒZdS )ÚMobileé   r   r   r   c                 C   s   dd l }| |¡| _d S )Nr   )ÚweakrefÚproxyÚ_driver)r   Údriverr   r   r   r   r	   -   s   zMobile.__init__c                 C   s   |   | j tj¡d ¡S )NÚvalue)ÚConnectionTyper   Úexecuter   ÚGET_NETWORK_CONNECTIONr   r   r   r   Únetwork_connection2   s   zMobile.network_connectionc                 C   s:   t || jƒr	|jn|}|  | j tjdd|idœ¡d ¡S )zµSet the network connection for the remote device.

        Example of setting airplane mode::

            driver.mobile.set_network_connection(driver.mobile.AIRPLANE_MODE)
        r!   Útype)ÚnameÚ
parametersr   )Ú
isinstancer   r   r   r   r   ÚSET_NETWORK_CONNECTION)r   ÚnetworkÚmoder   r   r   Úset_network_connection6   s   ÿþÿzMobile.set_network_connectionc                 C   ó   | j  tj¡S )z0Returns the current context (Native or WebView).)r   r   r   ÚCURRENT_CONTEXT_HANDLEr   r   r   r   ÚcontextD   ó   zMobile.contextÚreturnNc                 C   s   | j  tjd|i¡ dS )zSets the current context.r#   N)r   r   r   ÚSWITCH_TO_CONTEXT)r   Únew_contextr   r   r   r,   I   s   c                 C   r*   )z%Returns a list of available contexts.)r   r   r   ÚCONTEXT_HANDLESr   r   r   r   ÚcontextsN   r-   zMobile.contexts)r.   N)r   r   r   r   r   ÚALL_NETWORKÚWIFI_NETWORKÚDATA_NETWORKÚAIRPLANE_MODEr	   r   r!   r)   r,   Úsetterr2   r   r   r   r   r   &   s     

r   N)Úcommandr   r   r   r   r   r   r   Ú<module>   s   