o
    ѷ6i                     @   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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 when an attribute lookup happens:

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

    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`)

    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	   f/var/www/hoanhtaovolam_webdjango/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__/   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__4   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_capabilitiesM   s   
zOptions.default_capabilitiesN)r   r   r   AUTOMATIC_INSPECTIONAUTOMATIC_PROFILINGSAFARI_TECH_PREVIEWr   boolautomatic_inspectionautomatic_profilinguse_technology_previewpropertydictstrr    r	   r	   r	   r
   r   =   s    


r   N).selenium.webdriver.common.desired_capabilitiesr   !selenium.webdriver.common.optionsr   r   r   r	   r	   r	   r
   <module>   s   '