
    g                         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 d dl	m
Z
 d dlmZ d d	lmZ  G d
 d          Z G d de
          ZdS )    )Any)Dict)Optional)Union)
deprecated)DesiredCapabilities)
ArgOptions)FirefoxBinary)FirefoxProfilec                   "    e Zd ZddZdefdZdS )LogreturnNc                     d | _         d S Nlevelselfs    n/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/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#    : 	2GTZ011	r   r   N)__name__
__module____qualname__r   dictr    r   r   r   r      sC                 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e         fd            Zej	        de
eef         ddfd            Z	 ddee         f fdZdefdZedefd            Z xZS )Optionszmoz:firefoxOptionsr   Nc                     t                                                       d| _        i | _        d| j        d<   d | _        t                      | _        d S )N    zremote.active-protocols)superr   _binary_location_preferences_profiler   r   )r   	__class__s    r   r   zOptions.__init__+   sO     ""$ 89342655r   zuse binary_location insteadc                 *    t          | j                  S )z#Returns the FirefoxBinary instance.)r
   r'   r   s    r   binaryzOptions.binary5   s     T2333r   
new_binaryc                 f    t          |t                    r|j        }t          |          | _        dS )z\Sets location of the browser binary, either by string or
        ``FirefoxBinary`` instance.N)
isinstancer
   
_start_cmdstrbinary_location)r   r-   s     r   r,   zOptions.binary;   s2    
 j-00 	/#.J":r   c                     | j         S )z%:Returns: The location of the binary.)r'   r   s    r   r2   zOptions.binary_locationD   s     $$r   valuec                 f    t          |t                    st          | j                  || _        dS )z2Sets the location of the browser binary by string.N)r/   r1   	TypeErrorBINARY_LOCATION_ERRORr'   )r   r4   s     r   r2   zOptions.binary_locationI   s5     %%% 	8D6777 %r   c                     | j         S )z :Returns: A dict of preferences.r(   r   s    r   preferenceszOptions.preferencesP   s       r   namec                     || j         |<   dS )zSets a preference.Nr9   )r   r;   r4   s      r   set_preferencezOptions.set_preferenceU   s    "'$r   c                     | j         S )z%:Returns: The Firefox profile to use.)r)   r   s    r   profilezOptions.profileY   s     }r   new_profilec                 \    t          |t                    st          |          }|| _        dS )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.profile^   s.     +~66 	6(55K#r   org.mozilla.firefoxandroid_packagec                 N    t                                          |||           d S r   )r&   enable_mobile)r   rC   android_activitydevice_serialr*   s       r   rE   zOptions.enable_mobilef   s(     	o/?OOOOOr   c                 f   | j         }i }| j        r
| j        |d<   | j        r
| j        |d<   | j        r| j        j        |d<   | j        r
| j        |d<   | j        r|                    | 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_capabilitiesk   s     z!  	3!2DN 	. -DM= 	4"m3DO? 	+?DL 	-KK+,,,DH,,../// 	% $Dr   c                 >    t           j                                        S r   )r   FIREFOXcopyr   s    r   default_capabilitieszOptions.default_capabilities   s    "*//111r   r   )rB   NN)r   r   r   rP   r   propertyr   r
   r,   setterr   r1   r2   r   r:   intboolr=   r   r   r?   rE   r   rV   __classcell__)r*   s   @r   r"   r"   (   sb       
C      Z-..4 4 4 4 /. X4 ]Z-../sM'9!: /t / / / /. ]/ % % % % X% &S &T & & & & !T ! ! ! X!(3 (uS#t^/D ( ( ( ( .1    X ^$5n)<#= $$ $ $ $ ^$ lpP P'}P P P P P P
    6 2d 2 2 2 X2 2 2 2 2r   r"   N)typingr   r   r   r   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>rb      s  "                         ( ( ( ( ( ( N N N N N N 8 8 8 8 8 8 C C C C C C E E E E E E       `2 `2 `2 `2 `2j `2 `2 `2 `2 `2r   