
    8hA                     r    d dl 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)    N)Union)DesiredCapabilities)
ArgOptions)FirefoxBinary)FirefoxProfilec                        e Zd ZddZdefdZy)LogreturnNc                     d | _         y Nlevelselfs    y/home/stella.sw7ft.com/public_html/site_rebuilder/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                   j    e Zd ZdZd fdZedefd       Zej                  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 r   )superr   _binary_preferences_profiler	   r   )r   	__class__s    r   r   zOptions.__init__'   s-    7;"$5r   c                     | j                   S )z#Returns the FirefoxBinary instance.)r!   r   s    r   binaryzOptions.binary.   s     ||r   
new_binaryc                 H    t        |t              st        |      }|| _        y)z\Sets location of the browser binary, either by string or
        ``FirefoxBinary`` instance.N)
isinstancer   r!   )r   r'   s     r   r&   zOptions.binary3   s     *m4&z2J!r   c                 .    | j                   j                  S )z%:Returns: The location of the binary.)r&   
_start_cmdr   s    r   binary_locationz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_location@   s&     %%D6677r   c                     | j                   S )z :Returns: A dict of preferences.r"   r   s    r   preferenceszOptions.preferencesG   s        r   namec                 "    || j                   |<   y)zSets a preference.Nr3   )r   r5   r-   s      r   set_preferencezOptions.set_preferenceL   s    "'$r   c                     | j                   S )z%:Returns: The Firefox profile to use.)r#   r   s    r   profilezOptions.profileP   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   r9   zOptions.profileU   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                  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&   prefsr9   args)_capsr!   r+   r"   r#   encoded
_argumentsmobile_optionsupdater   r   r   KEY)r   capsoptss      r   r   zOptions.to_capabilities`   s     zz<<!\\44D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   rI   r   propertyr   r&   setterr   r/   r,   r   r4   intboolr7   r   r9   r>   r   rO   __classcell__)r$   s   @r   r   r   $   sT   
C    ]]"sM'9!: "t " " & & & S T   !T ! !(3 (uS#t^/D (    ^^$5n)<#= $$ $ $PS P 6 2d 2 2r   r   )typingr   .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>rZ      s1   "   N 8 C E Y2j Y2r   