B
     ¸h[
  ã               @   s    d dl mZ G dd„ deƒZdS )é   )ÚCommandc               @   s~   e Zd ZG dd„ d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
dd„ ƒZej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   ú]C:\Users\sanjo\AppData\Local\Qlobot\Launcher\ext_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 )Nr	   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 S )N)Ú_driver)r   Údriverr   r   r   r   -   s    zMobile.__init__c             C   s   |   | j tj¡d ¡S )NÚvalue)r   r   Úexecuter   ÚGET_NETWORK_CONNECTION)r   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   ÚSET_NETWORK_CONNECTION)r   ÚnetworkÚmoder   r   r   Úset_network_connection4   s
    
zMobile.set_network_connectionc             C   s   | j  tj¡S )zB
        returns the current context (Native or WebView).
        )r   r   r   ÚCURRENT_CONTEXT_HANDLE)r   r   r   r   ÚcontextB   s    zMobile.contextc             C   s   | j  tj¡S )z6
        returns a list of available contexts
        )r   r   r   ÚCONTEXT_HANDLES)r   r   r   r   ÚcontextsI   s    zMobile.contextsc             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$   P   s    N)r   r   r   Úobjectr   ZALL_NETWORKZWIFI_NETWORKZDATA_NETWORKZAIRPLANE_MODEr   r   r   r"   r$   r&   Úsetterr   r   r   r   r      s   r   N)Úcommandr   r(   r   r   r   r   r   Ú<module>   s   