o
    US`cã  ã                   @   sB   d dl Z d dlmZ d dlmZ G dd„ dƒZG dd„ deƒZdS )é    N)ÚDesiredCapabilities)Ú
ArgOptionsc                   @   s$   e Zd Zddd„Zdefdd„ZdS )ÚLogÚreturnNc                 C   s
   d | _ d S ©N©Úlevel©Úself© r   úL/usr/local/lib/python3.10/dist-packages/selenium/webdriver/safari/options.pyÚ__init__   s   
zLog.__init__c                 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_capabilities©r   N)Ú__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d‡ fdd„Zede	fd	d
„ƒZ
e
jde	ddfdd
„ƒZ
defdd„Zedeje	e	f fdd„ƒZedefdd„ƒZejdeddfdd„ƒZedefdd„ƒZejdeddfdd„ƒZedefdd„ƒZejdeddfdd„ƒZ‡  ZS )ÚOptionszsafari.optionszsafari:automaticInspectionzsafari:automaticProfilingzSafari Technology Previewr   Nc                    s"   t ƒ  ¡  d | _i | _tƒ | _d S r   )Úsuperr   Ú_binary_locationZ_preferencesr   r   r	   ©Ú	__class__r   r   r   *   s   
zOptions.__init__c                 C   s   | j S )zX
        :Returns: The location of the browser binary otherwise an empty string
        ©r   r	   r   r   r   Úbinary_location0   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   7   s   
c                 C   sL   | j }i }| jr| j|d< | jr| j|d< | | j ¡ ¡ |r$||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   A   s   


zOptions.to_capabilitiesc                 C   s
   t j ¡ S r   )r   ZSAFARIÚcopyr	   r   r   r   Údefault_capabilitiesV   s   
zOptions.default_capabilitiesc                 C   ó   | j  | j¡S )z0:Returns: The option Automatic Inspection value )r    ÚgetÚAUTOMATIC_INSPECTIONr	   r   r   r   Úautomatic_inspectionZ   ó   zOptions.automatic_inspectionc                 C   ó   |   | j|¡ dS )zp
        Sets the option Automatic Inspection to value

        :Args:
         - value: boolean value

        N)Úset_capabilityr(   r   r   r   r   r)   _   ó   	c                 C   r&   )z0:Returns: The options Automatic Profiling value )r    r'   ÚAUTOMATIC_PROFILINGr	   r   r   r   Úautomatic_profilingj   r*   zOptions.automatic_profilingc                 C   r+   )zo
        Sets the option Automatic Profiling to value

        :Args:
         - value: boolean value

        N)r,   r.   r   r   r   r   r/   o   r-   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_previewz   s   zOptions.use_technology_previewc                 C   s    |   d|r| j¡ dS d¡ dS )zŠ
        Sets browser name to Safari Technology Preview if value else to safari.

        :Args:
         - value: boolean value

        r0   ZsafariN)r,   r1   r   r   r   r   r2      s    	r   )r   r   r   r"   r(   r.   r1   r   ÚpropertyÚstrr   Úsetterr   r   ÚtypingÚDictr%   Úboolr)   r/   r2   Ú__classcell__r   r   r   r   r   !   s2    	

r   )r6   Z.selenium.webdriver.common.desired_capabilitiesr   Z!selenium.webdriver.common.optionsr   r   r   r   r   r   r   Ú<module>   s
   
