U
    Ð~fhœ  ã                   @   s4   d dl Z d dlmZ d dlmZ G dd„ deƒZdS )é    N)ÚDesiredCapabilities)Ú
ArgOptionsc                       sr   e Zd ZdZddœ‡ fdd„Zeedœdd„ƒZejeddœd	d„ƒZd
d„ Z	ee
jeef dœdd„ƒZ‡  ZS )ÚOptionszwpe:browserOptionsN)Úreturnc                    s   t ƒ  ¡  d| _d S )NÚ )ÚsuperÚ__init__Ú_binary_location©Úself©Ú	__class__© úH/tmp/pip-unpacked-wheel-_w7xr53_/selenium/webdriver/wpewebkit/options.pyr      s    
zOptions.__init__c                 C   s   | j S )zMReturns the location of the browser binary otherwise an empty
        string.)r	   r
   r   r   r   Úbinary_location   s    zOptions.binary_location)Úvaluer   c                 C   s   t |tƒst| jƒ‚|| _dS )zvAllows you to set the browser binary to launch.

        :Args:
         - value : path to the browser binary
        N)Ú
isinstanceÚstrÚ	TypeErrorZBINARY_LOCATION_ERRORr	   )r   r   r   r   r   r   $   s    

c                 C   s8   | j }i }| jr| j|d< | jr*| j|d< ||tj< |S )zpCreates a capabilities with all the options that have been set and
        returns a dictionary with everything.ÚbinaryÚargs)Z_capsr   Ú	argumentsr   ÚKEY)r   ZcapsZbrowser_optionsr   r   r   Úto_capabilities/   s    


zOptions.to_capabilitiesc                 C   s
   t j ¡ S )N)r   Z	WPEWEBKITÚcopyr
   r   r   r   Údefault_capabilities>   s    zOptions.default_capabilities)Ú__name__Ú
__module__Ú__qualname__r   r   Úpropertyr   r   Úsetterr   ÚtypingÚDictr   Ú__classcell__r   r   r   r   r      s   
r   )r!   Z.selenium.webdriver.common.desired_capabilitiesr   Z!selenium.webdriver.common.optionsr   r   r   r   r   r   Ú<module>   s   