a
    ŠxdA
  ã                   @   s   d dl mZ G dd„ dƒZdS )é   )ÚCommandc                   @   s‚   e Zd ZG dd„ dƒ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d„ƒZe	dd„ ƒZdS )ÚMobilec                   @   s8   e Zd Zdd„ Zedd„ ƒZedd„ ƒZedd„ ƒZd	S )
zMobile.ConnectionTypec                 C   s
   || _ d S )N©Úmask)Úselfr   © r   úX/var/www/html/Ranjet/env/lib/python3.9/site-packages/selenium/webdriver/remote/mobile.pyÚ__init__   s    zMobile.ConnectionType.__init__c                 C   s   | j d dkS ©Né   r   r   ©r   r   r   r   Úairplane_mode   s    z#Mobile.ConnectionType.airplane_modec                 C   s   | j d d dkS r
   r   r   r   r   r   Úwifi   s    zMobile.ConnectionType.wific                 C   s   | j d dkS )Né   é    r   r   r   r   r   Údata"   s    zMobile.ConnectionType.dataN)Ú__name__Ú
__module__Ú__qualname__r	   Úpropertyr   r   r   r   r   r   r   ÚConnectionType   s   

r   é   r   r   r   c                 C   s   dd l }| |¡| _d S )Nr   )ÚweakrefÚproxyÚ_driver)r   Zdriverr   r   r   r   r	   +   s    zMobile.__init__c                 C   s   |   | j tj¡d ¡S )NÚvalue)r   r   Úexecuter   ZGET_NETWORK_CONNECTIONr   r   r   r   Únetwork_connection0   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   ZSET_NETWORK_CONNECTION)r   ÚnetworkÚmoder   r   r   Úset_network_connection4   s    ÿþÿzMobile.set_network_connectionc                 C   s   | j  tj¡S )z0returns the current context (Native or WebView).)r   r   r   ZCURRENT_CONTEXT_HANDLEr   r   r   r   ÚcontextB   s    zMobile.contextN)Úreturnc                 C   s   | j  tjd|i¡ dS )zsets the current context.r   N)r   r   r   ZSWITCH_TO_CONTEXT)r   Znew_contextr   r   r   r%   G   s    c                 C   s   | j  tj¡S )z%returns a list of available contexts.)r   r   r   ZCONTEXT_HANDLESr   r   r   r   ÚcontextsL   s    zMobile.contexts)r   r   r   r   ZALL_NETWORKZWIFI_NETWORKZDATA_NETWORKZAIRPLANE_MODEr	   r   r   r$   r%   Úsetterr'   r   r   r   r   r      s   

r   N)Úcommandr   r   r   r   r   r   Ú<module>   s   