
    >fh                     V    d dl mZmZ d dlmZ d dlmZ  G d dej                        Zy)    )MappingSequence)Optional)servicec                   0    e Zd ZdZ	 	 	 	 	 	 	 ddee   dedeee      deeeef      de	dee   d	df fd
Z
d	ee   fdZed	efd       Zed	e	fd       Zej                   de	d	dfd       Zed	ee   fd       Zej                   dee   fd       Z xZS )Servicea/  A Service class that is responsible for the starting and stopping of
    `safaridriver`  This is only supported on MAC OSX.

    :param executable_path: install path of the safaridriver executable, defaults to `/usr/bin/safaridriver`.
    :param port: Port for the service to run on, defaults to 0 where the operating system will decide.
    :param service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable.
    :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
    :param enable_logging: (Optional) Enable logging of the service. Logs can be located at
        `~/Library/Logs/com.apple.WebDriver/`
    :param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
    Nexecutable_pathportservice_argsenvenable_loggingdriver_path_env_keyreturnc                     t        |xs g       | _        |xs d}|r| j                  j                  d       || _        t	        	|   d||||d| y )NSE_SAFARIDRIVERz
--diagnose)r	   r
   r   r    )list_service_argsappendreuse_servicesuper__init__)
selfr	   r
   r   r   r   r   r   kwargs	__class__s
            T/var/www/zara/venv/lib/python3.12/site-packages/selenium/webdriver/safari/service.pyr   zService.__init__%   sj     ","4"51F5F%%l3* 	
+ 3		

 	
    c                 :    d| j                    g| j                  z   S )Nz-p)r
   r   r   s    r   command_line_argszService.command_line_args?   s    %(:(:::r   c                      d| j                    S )z)Gets the url of the SafariDriver Service.zhttp://localhost:)r
   r   s    r   service_urlzService.service_urlB   s     #499+..r   c                     | j                   S N)_reuse_servicer   s    r   r   zService.reuse_serviceG   s    """r   reusec                 H    t        |t              st        d      || _        y )Nzreuse must be a boolean)
isinstancebool	TypeErrorr%   )r   r&   s     r   r   zService.reuse_serviceK   s     %&566#r   c                     | j                   S r$   )r   r   s    r   r   zService.service_argsQ   s    !!!r   valuec                 z    t        |t              st        |t              st        d      t	        |      | _        y )Nzservice_args must be a sequence)r(   strr   r*   r   r   )r   r,   s     r   r   zService.service_argsU   s-    eS!E8)D=>>!%[r   )Nr   NNFFN)__name__
__module____qualname____doc__r   r.   intr   r   r)   r   r   r    propertyr"   r   setterr   __classcell__)r   s   @r   r   r      s9   
 *.04+/$-1
!#
 
 x}-	

 gc3h'(
 
 &c]
 

4;49 ; /S / / #t # # $4 $D $ $
 "hsm " " )(3- ) )r   r   N)collections.abcr   r   typingr   selenium.webdriver.commonr   r   r   r   r   <module>r:      s"   $ .  -A)goo A)r   