
    $)f                     v    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ  G d d      Z G d	 d
e      Zy)    )Union)
deprecated)DesiredCapabilities)
ArgOptions)FirefoxBinary)FirefoxProfilec                        e Zd ZddZdefdZy)LogreturnNc                     d | _         y Nlevelselfs    _/var/www/html/flask-app/venv/lib/python3.12/site-packages/selenium/webdriver/firefox/options.py__init__zLog.__init__   s	    
    c                 >    | j                   rdd| j                   iiS i S )Nlogr   r   r   s    r   to_capabilitieszLog.to_capabilities   s"    ::GTZZ011	r   r   N)__name__
__module____qualname__r   dictr    r   r   r
   r
      s     r   r
   c                       e Zd ZdZd fdZe ed      defd              Zej                   ed      de
eef   ddfd              Zedefd	       Zej                  d
eddfd       Zedefd       Zded
e
eeef   fdZedefd       Zej                  de
eef   ddfd       Zddef fdZdefdZedefd       Z xZS )Optionszmoz:firefoxOptionsr   Nc                 j    t         |           d| _        i | _        d | _        t               | _        y )N )superr   _binary_location_preferences_profiler
   r   )r   	__class__s    r   r   zOptions.__init__(   s.     ""$5r   zuse binary_location insteadc                 ,    t        | j                        S )z#Returns the FirefoxBinary instance.)r   r#   r   s    r   binaryzOptions.binary/   s     T2233r   
new_binaryc                 J    t        |t              r|j                  }|| _        y)z\Sets location of the browser binary, either by string or
        ``FirefoxBinary`` instance.N)
isinstancer   
_start_cmdbinary_location)r   r)   s     r   r(   zOptions.binary5   s!    
 j-0#..J)r   c                     | j                   S )z%:Returns: The location of the binary.)r#   r   s    r   r-   zOptions.binary_location>   s     $$$r   valuec                 \    t        |t              st        | j                        || _        y)z2Sets the location of the browser binary by string.N)r+   str	TypeErrorBINARY_LOCATION_ERRORr#   )r   r/   s     r   r-   zOptions.binary_locationC   s'     %%D6677 %r   c                     | j                   S )z :Returns: A dict of preferences.r$   r   s    r   preferenceszOptions.preferencesJ   s        r   namec                 "    || j                   |<   y)zSets a preference.Nr5   )r   r7   r/   s      r   set_preferencezOptions.set_preferenceO   s    "'$r   c                     | j                   S )z%:Returns: The Firefox profile to use.)r%   r   s    r   profilezOptions.profileS   s     }}r   new_profilec                 H    t        |t              st        |      }|| _        y)z\Sets location of the browser profile to use, either by string or
        ``FirefoxProfile``.N)r+   r   r%   )r   r<   s     r   r;   zOptions.profileX   s     +~6(5K#r   android_packagec                 (    t         |   |||       y r   )r"   enable_mobile)r   r>   android_activitydevice_serialr&   s       r   r@   zOptions.enable_mobile`   s    o/?Or   c                    | j                   }i }| j                  r| j                  |d<   | j                  r| j                  |d<   | j                  r| j                  j                  |d<   | j
                  r| j
                  |d<   | j                  r|j                  | j                         |j                  | j                  j                                |r||t        j                  <   |S )z>Marshals the Firefox options to a `moz:firefoxOptions` object.r(   prefsr;   args)_capsr#   r$   r%   encoded
_argumentsmobile_optionsupdater   r   r   KEY)r   capsoptss      r   r   zOptions.to_capabilitiesc   s     zz  !22DN --DM=="mm33DO????DLKK++,DHH,,./ $Dr   c                 >    t         j                  j                         S r   )r   FIREFOXcopyr   s    r   default_capabilitieszOptions.default_capabilities~   s    "**//11r   r   )zorg.mozilla.firefoxNN)r   r   r   rK   r   propertyr   r   r(   setterr   r1   r-   r   r6   intboolr9   r   r;   r@   r   rQ   __classcell__)r&   s   @r   r   r   %   sp   
C -.4 4 / 4 ]]-.*sM'9!: *t * / * % % % &S &T & & !T ! !(3 (uS#t^/D (    ^^$5n)<#= $$ $ $PS P 6 2d 2 2r   r   N)typingr   typing_extensionsr   .selenium.webdriver.common.desired_capabilitiesr   !selenium.webdriver.common.optionsr   )selenium.webdriver.firefox.firefox_binaryr   *selenium.webdriver.firefox.firefox_profiler   r
   r   r   r   r   <module>r]      s1   "  ( N 8 C E [2j [2r   