o
    US`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__ Q/usr/local/lib/python3.10/dist-packages/selenium/webdriver/webkitgtk/webdriver.pyr      s    



zWebDriver.__init__c                    sR   z"zt    W n
 tjy   Y n	w W | j  dS W | j  dS | j  w )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
   