U
    g                     @   sP   d dl mZ d dlmZ d dlmZ ddlm	Z	 ddl
mZ G dd deZdS )	    N)DriverFinder)	WebDriver   )Options)Servicec                       s4   e Zd ZdZded fddZ fddZ  ZS )	r   zAControls the WPEWebKitDriver and allows you to drive the browser.N)servicec                    sZ   |r|nt  }|r|nt | _t| j| | j_| j  t j| jj	|d d| _
dS )a6  Creates a new instance of the WPEWebKit driver.

        Starts the service and then creates new instance of WPEWebKit Driver.

        :Args:
         - options : an instance of ``WPEWebKitOptions``
         - service : Service object for handling the browser driver if you need to pass extra details
        )Zcommand_executoroptionsFN)r   r   r   r   Zget_driver_pathpathstartsuper__init__Zservice_urlZ
_is_remote)selfr   r   	__class__ J/tmp/pip-unpacked-wheel-3ysq0mf8/selenium/webdriver/wpewebkit/webdriver.pyr      s    
zWebDriver.__init__c                    s<   z*zt   W n tjk
r&   Y nX W 5 | j   X dS )z{Closes the browser and shuts down the WPEWebKitDriver executable
        that is started when starting the WPEWebKitDriver.N)r   stopr   quithttp_clientBadStatusLine)r   r   r   r   r   4   s
    
zWebDriver.quit)NN)__name__
__module____qualname____doc__r   r   r   __classcell__r   r   r   r   r      s     r   )http.clientclientr   Z'selenium.webdriver.common.driver_finderr   Z#selenium.webdriver.remote.webdriverr   ZRemoteWebDriverr   r   r   r   r   r   r   r   <module>   s
   