o
    ѷ6i                     @   s2   d dl mZmZ d dlmZ G dd dejZdS )    )MappingSequence)servicec                       s   e Zd ZdZ							ddedB dedee dB deeef dB d	ed
edB ddf fddZ	de
e fddZedefddZedefddZejdeddfddZedee fddZejdee fddZ  ZS )Servicea  Manage the safaridriver service lifecycle (start/stop).

    This service is only supported on macOS.

    Args:
        executable_path: install path of the safaridriver executable, defaults to `/usr/bin/safaridriver`.
        port: Port for the service to run on, defaults to 0 where the operating system will decide.
        service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable.
        env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
        enable_logging: (Optional) Enable logging of the service. Logs can be located at
            `~/Library/Logs/com.apple.WebDriver/`
        driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
    Nr   Fexecutable_pathportservice_argsenvenable_loggingdriver_path_env_keyreturnc           	         sL   t |pg | _|p
d}|r| jd || _t jd||||d| d S )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__r   f/var/www/hoanhtaovolam_webdjango/env/lib/python3.10/site-packages/selenium/webdriver/safari/service.pyr   &   s   
zService.__init__c                 C   s   d| j  g| j S )Nz-p)r   r   r   r   r   r   command_line_args@   s   zService.command_line_argsc                 C   s   d| j  S )z)Gets the url of the SafariDriver Service.zhttp://localhost:)r   r   r   r   r   service_urlC   s   zService.service_urlc                 C      | j S )N)_reuse_servicer   r   r   r   r   H   s   zService.reuse_servicereusec                 C   s   t |ts	td|| _d S )Nzreuse must be a boolean)
isinstancebool	TypeErrorr   )r   r   r   r   r   r   L   s   

c                 C   r   )z*Returns the sequence of service arguments.)r   r   r   r   r   r   R   s   zService.service_argsvaluec                 C   s*   t |ts
t |tstdt|| _d S )Nzservice_args must be a sequence)r    strr   r"   r   r   )r   r#   r   r   r   r   W   s   )Nr   NNFFN)__name__
__module____qualname____doc__r$   intr   r   r!   r   r   r   propertyr   r   setterr   __classcell__r   r   r   r   r      sF    

r   N)collections.abcr   r   selenium.webdriver.commonr   r   r   r   r   r   <module>   s   