a
    Ã&Ï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   úe/var/www/html/swiplay.fr/scambot/venv/lib/python3.9/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   s    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!   s    z_ConnectionType.dataN)Ú__name__Ú
__module__Ú__qualname__r	   Úpropertyr   r   r   r   r   r   r   r      s   

r   c                   @   sx   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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   s   | j  tj¡S )z0Returns the current context (Native or WebView).)r   r   r   ÚCURRENT_CONTEXT_HANDLEr   r   r   r   ÚcontextD   s    zMobile.contextN)Úreturnc                 C   s   | j  tjd|i¡ dS )zSets the current context.r"   N)r   r   r   ÚSWITCH_TO_CONTEXT)r   Znew_contextr   r   r   r*   I   s    c                 C   s   | j  tj¡S )z%Returns a list of available contexts.)r   r   r   ÚCONTEXT_HANDLESr   r   r   r   ÚcontextsN   s    zMobile.contexts)r   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   r   Ú<module>   s   