a
    ¾Ê.cš  ã                   @   sH   d dl mZ d dlmZ ddlmZmZ ddl	m
Z
 G dd„ deƒZdS )é    N)Ú	WebDriveré   )ÚDEFAULT_EXECUTABLE_PATHÚService)ÚOptionsc                       s:   e Zd ZdZedddddf‡ fdd„	Z‡ fdd„Z‡  ZS )	r   zK
    Controls the WebKitGTKDriver and allows you to drive the browser.
    r   NFc                    sh   |s|s.t ƒ  ¡ }n| ¡ }|r*| |¡ |}t|||d| _| j ¡  tƒ j| jj||d d| _	dS )a¡  
        Creates a new instance of the WebKitGTK driver.

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

        :Args:
         - executable_path : path to the executable. If the default is used it assumes the executable is in the $PATH.
         - port : port you would like the service to run, if left as 0, a free port will be found.
         - options : an instance of WebKitGTKOptions
         - desired_capabilities : Dictionary object with desired capabilities
         - service_log_path : Path to write service stdout and stderr output.
         - keep_alive : Whether to configure RemoteConnection to use HTTP keep-alive.
        )ÚportÚlog_path)Zcommand_executorÚdesired_capabilitiesÚ
keep_aliveFN)
r   Zto_capabilitiesÚupdater   ÚserviceÚstartÚsuperÚ__init__Zservice_urlZ
_is_remote)ÚselfZexecutable_pathr   Úoptionsr	   Zservice_log_pathr
   Zcapabilities©Ú	__class__© ú`/var/www/brookimports/venv/lib/python3.9/site-packages/selenium/webdriver/webkitgtk/webdriver.pyr      s    

ýzWebDriver.__init__c                    sD   z2zt ƒ  ¡  W n tjy$   Y n0 W | j ¡  n| j ¡  0 dS )zŒ
        Closes the browser and shuts down the WebKitGTKDriver executable
        that is started when starting the WebKitGTKDriver
        N)r   ÚquitÚhttp_clientÚBadStatusLiner   Ústop)r   r   r   r   r   A   s
    zWebDriver.quit)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__classcell__r   r   r   r   r      s   þ"r   )Úhttp.clientÚclientr   Z#selenium.webdriver.remote.webdriverr   ZRemoteWebDriverr   r   r   r   r   r   r   r   r   Ú<module>   s   