HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/compose/cli/__pycache__/errors.cpython-310.pyc
o

S�`B�@sDddlZddlZddlZddlmZddlmZddlmZddl	m
Zddl	mZddl	m
Z
ddlmZd	d
lmZddlmZdd
lmZddlmZddlmZddlmZe�e�ZGdd�de�ZGdd�de�Z
ejdd��Zdd�Zdd�Z dd�Z!dd�Z"dd �Z#d!d"�Z$d#d$�Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,dS),�N)�find_executable)�dedent)�APIError)�ConnectionError)�ReadTimeout)�SSLError)�ReadTimeoutError�)�API_VERSION_TO_ENGINE_VERSION�)�binarystr_to_unicode)�is_docker_for_mac_installed)�is_mac)�	is_ubuntu)�
is_windowsc@seZdZdd�Zdd�ZdS)�	UserErrorcCst|���|_dS�N)r�strip�msg)�selfr�r�4/usr/lib/python3/dist-packages/compose/cli/errors.py�__init__szUserError.__init__cCs|jSr�r)rrrr�__str__szUserError.__str__N)�__name__�
__module__�__qualname__rrrrrrrsrc@seZdZdS)rN)rrrrrrrr!src
cs�zdVWdSty}z
t�d|�t��d}~wtyI}z!|jr7t|jdt�r7t|j	�t��t
t|j��WYd}~dSd}~wt
y]}z	t||j�t��d}~wttj	fynt|j	�t��ty�}zt�r�ddl}t||j�r�t|�t���d}~ww)Nz
SSL error: %sr)r�log�errorr�RequestsConnectionError�args�
isinstancer�log_timeout_error�timeout�exit_with_error�get_conn_error_message�base_urlr�
log_api_error�api_versionr�socket�	Exceptionr�
pywintypes�log_windows_pipe_error)�client�er,rrr�handle_connection_errors%s:��
��
��r0cCsN|jdkrt�d�dS|jdkrt�d�dSt�d�t|j�|j��dS)Nr	zNCouldn't connect to Docker daemon. You might need to start Docker for Windows.��z�The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.z'Windows named pipe error: {} (code: {}))�winerrorrr�formatr�strerror)�excrrrr-@s

���r-cCst�d|�dS)Nz�An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: %s).)rr)r$rrrr#Qs
��r#cCsRt|j�}d|vrt�|�dSt�|�}|st�|�dSt�dj|d��dS)Nzclient is newer than serverz�The Docker Engine version is less than the minimum required by Compose. Your current project requires a Docker Engine of version {version} or greater.)�version)r�explanationrrr
�getr3)r/�client_versionr7r6rrrr(Zs



��r(cCst�t|����t��r)rrrrrrrrrr%nsr%cCsXztd�durtd�WSt�rtWStd�durtWSWn	ty%Ynwtj|d�S)N�dockerz"Couldn't connect to Docker daemon.zdocker-machine��url)r�docker_not_found_msgr
�conn_error_docker_for_mac�conn_error_docker_machine�UnicodeDecodeError�conn_error_genericr3r;rrrr&ss
��r&cCsd�|t��S)Nz({} You might need to install Docker:

{})r3�docker_install_url)�problemrrrr=�s�r=cCs"t�rtSt�r
tSt�rtStSr)r�docker_install_url_macr�docker_install_url_ubuntur�docker_install_url_windows�docker_install_url_genericrrrrrB�srBz0https://docs.docker.com/engine/installation/mac/z8https://docs.docker.com/engine/installation/ubuntulinux/z4https://docs.docker.com/engine/installation/windows/z,https://docs.docker.com/engine/installation/z_
    Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
zP
    Couldn't connect to Docker daemon. You might need to start Docker for Mac.
z�
    Couldn't connect to Docker daemon at {url} - is it running?

    If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
)-�
contextlib�loggingr*�distutils.spawnr�textwrapr�
docker.errorsr�requests.exceptionsrr rr�$requests.packages.urllib3.exceptionsr�constr
�utilsrr
rrr�	getLoggerrrr+r�contextmanagerr0r-r#r(r%r&r=rBrDrErFrGr?r>rArrrr�<module>sF