a
    ¾Ê.c“  ã                   @   s:   d dl mZ d dlmZ G dd„ dƒZG dd„ deƒZdS )é    )ÚDesiredCapabilities)Ú
ArgOptionsc                   @   s"   e Zd Zdd„ Zedœdd„ZdS )ÚLogc                 C   s
   d | _ d S ©N©Úlevel©Úself© r
   ú[/var/www/brookimports/venv/lib/python3.9/site-packages/selenium/webdriver/safari/options.pyÚ__init__   s    zLog.__init__©Úreturnc                 C   s   | j rdd| j iiS i S )NÚlogr   r   r   r
   r
   r   Úto_capabilities   s    zLog.to_capabilitiesN)Ú__name__Ú
__module__Ú__qualname__r   Údictr   r
   r
   r
   r   r      s   r   c                       sä   e Zd ZdZdZdZdZ‡ fdd„Zee	dœdd	„ƒZ
e
je	d
œdd	„ƒZ
edœdd„Zeedœdd„ƒZeedœdd„ƒZejed
œdd„ƒZeedœdd„ƒZejed
œdd„ƒZeedœdd„ƒZejed
œdd„ƒZ‡  ZS )ÚOptionszsafari.optionszsafari:automaticInspectionzsafari:automaticProfilingzSafari Technology Previewc                    s"   t ƒ  ¡  d | _i | _tƒ | _d S r   )Úsuperr   Ú_binary_locationZ_preferencesr   r   r   ©Ú	__class__r
   r   r   (   s    
zOptions.__init__r   c                 C   s   | j S )zX
        :Returns: The location of the browser binary otherwise an empty string
        ©r   r   r
   r
   r   Úbinary_location.   s    zOptions.binary_location)Úvaluec                 C   s
   || _ dS )z~
        Allows you to set the browser binary to launch

        :Args:
         - value : path to the browser binary
        Nr   ©r	   r   r
   r
   r   r   5   s    c                 C   sL   | j }i }| jr| j|d< | jr*| j|d< | | j ¡ ¡ |rH||tj< |S )zAMarshals the  options to an desired capabilities object.
        ÚargsÚbinary)Ú_capsZ
_argumentsr   Úupdater   r   r   ÚKEY)r	   ZcapsÚoptsr
   r
   r   r   ?   s    


zOptions.to_capabilitiesc                 C   s
   t j ¡ S r   )r   ZSAFARIÚcopyr   r
   r
   r   Údefault_capabilitiesT   s    zOptions.default_capabilitiesc                 C   s   | j  | j¡S )z0:Returns: The option Automatic Inspection value )r    ÚgetÚAUTOMATIC_INSPECTIONr   r
   r
   r   Úautomatic_inspectionX   s    zOptions.automatic_inspectionc                 C   s   |   | j|¡ dS )zp
        Sets the option Automatic Inspection to value

        :Args:
         - value: boolean value

        N)Úset_capabilityr'   r   r
   r
   r   r(   ]   s    	c                 C   s   | j  | j¡S )z0:Returns: The options Automatic Profiling value )r    r&   ÚAUTOMATIC_PROFILINGr   r
   r
   r   Úautomatic_profilingh   s    zOptions.automatic_profilingc                 C   s   |   | j|¡ dS )zo
        Sets the option Automatic Profiling to value

        :Args:
         - value: boolean value

        N)r)   r*   r   r
   r
   r   r+   m   s    	c                 C   s   | j  d¡| jkS )zD:Returns: whether BROWSER_NAME is equal to Safari Technology PreviewÚbrowserName)r    r&   ÚSAFARI_TECH_PREVIEWr   r
   r
   r   Úuse_technology_previewx   s    zOptions.use_technology_previewc                 C   s   |   d|r| jnd¡ dS )zŠ
        Sets browser name to Safari Technology Preview if value else to safari.

        :Args:
         - value: boolean value

        r,   ZsafariN)r)   r-   r   r
   r
   r   r.   }   s    	)r   r   r   r"   r'   r*   r-   r   ÚpropertyÚstrr   Úsetterr   r   r%   Úboolr(   r+   r.   Ú__classcell__r
   r
   r   r   r      s0   	

r   N)Z.selenium.webdriver.common.desired_capabilitiesr   Z!selenium.webdriver.common.optionsr   r   r   r
   r
   r
   r   Ú<module>   s   
