o
    U!h                     @   sF   d dl mZ d dlmZ d dlmZ G dd dZG dd deZdS )	    )Dict)DesiredCapabilities)
ArgOptionsc                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	_SafariOptionsDescriptora!  _SafariOptionsDescriptor is an implementation of Descriptor protocol:

    : Any look-up or assignment to the below attributes in `Options` class will be intercepted
    by `__get__` and `__set__` method respectively.

    - `automatic_inspection`
    - `automatic_profiling`
    - `use_technology_preview`

    : When an attribute lookup happens,
    Example:
        `self.automatic_inspection`
        `__get__` method does a dictionary look up in the dictionary `_caps` of `Options` class
        and returns the value of key `safari:automaticInspection`
    : When an attribute assignment happens,
    Example:
        `self.automatic_inspection` = True
        `__set__` method sets/updates the value of the key `safari:automaticInspection` in `_caps`
        dictionary in `Options` class.
    c                 C   s   || _ || _d S N)nameexpected_type)selfr   r    r
   /var/www/html/contec/backend/tec.wsc/Coding/backend/Contec_Project_backend/env/lib/python3.10/site-packages/selenium/webdriver/safari/options.py__init__-   s   
z!_SafariOptionsDescriptor.__init__c                 C   s*   | j dkr|jd| j kS |j| j S )NSafari Technology PreviewbrowserName)r   _capsget)r	   objclsr
   r
   r   __get__1   s   
z _SafariOptionsDescriptor.__get__c                 C   sT   t || jst| j d| j | jdkr"|r| jnd|jd< d S ||j| j< d S )Nz must be of type r   safarir   )
isinstancer   	TypeErrorr   r   )r	   r   valuer
   r
   r   __set__6   s
   
z _SafariOptionsDescriptor.__set__N)__name__
__module____qualname____doc__r   r   r   r
   r
   r
   r   r      s
    r   c                   @   sV   e Zd ZdZdZdZeeeZ	 eeeZ		 eeeZ
	 edeeef fddZdS )Optionszsafari:automaticInspectionzsafari:automaticProfilingr   returnc                 C   s
   t j S r   )r   SAFARIcopy)r	   r
   r
   r   default_capabilitiesq   s   
zOptions.default_capabilitiesN)r   r   r   AUTOMATIC_INSPECTIONAUTOMATIC_PROFILINGSAFARI_TECH_PREVIEWr   boolautomatic_inspectionautomatic_profilinguse_technology_previewpropertyr   strr!   r
   r
   r
   r   r   ?   s    


r   N)typingr   .selenium.webdriver.common.desired_capabilitiesr   !selenium.webdriver.common.optionsr   r   r   r
   r
   r
   r   <module>   s
   (