
                         &    S SK Jr   " S S\5      rg)   )format_environmentc                   z    \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	\
S 5       rS rS	 rS
 rSrg)ProxyConfig   z'
Hold the client's proxy configuration
c                 $    U R                  S5      $ )Nhttpgetselfs    %lib/third_party/docker/utils/proxy.pyr   ProxyConfig.http   s    xx    c                 $    U R                  S5      $ )Nhttpsr	   r   s    r   r   ProxyConfig.https   s    xx  r   c                 $    U R                  S5      $ )Nftpr	   r   s    r   r   ProxyConfig.ftp   s    xxr   c                 $    U R                  S5      $ )Nno_proxyr	   r   s    r   r   ProxyConfig.no_proxy   s    xx
##r   c                     [        U R                  S5      U R                  S5      U R                  S5      U R                  S5      S9$ )z
Instantiate a new ProxyConfig from a dictionary that represents a
client configuration, as described in `the documentation`_.

.. _the documentation:
    https://docs.docker.com/network/proxy/#configure-the-docker-client
	httpProxy
httpsProxyftpProxynoProxyr   r   r   r   )r   r
   )configs    r   	from_dictProxyConfig.from_dict   sA     K(**\*

:&ZZ	*	
 	
r   c                 2   0 nU R                   (       a  U R                   =US'   US'   U R                  (       a  U R                  =US'   US'   U R                  (       a  U R                  =US'   US'   U R                  (       a  U R                  =US'   US'   U$ )	z\
Return a dictionary representing the environment variables used to
set the proxy settings.

http_proxy
HTTP_PROXYhttps_proxyHTTPS_PROXY	ftp_proxy	FTP_PROXYr   NO_PROXYr   )r   envs     r   get_environmentProxyConfig.get_environment(   s    
 9948II=CL 1::6:jj@C]!38826((:Cs;/==04=C
Oc*o
r   c                 `    U (       d  U$ [        U R                  5       5      nU(       d  U$ X!-   $ )z
Given a list of strings representing environment variables, prepend the
environment variables corresponding to the proxy settings.
)r   r+   )r   environment	proxy_envs      r   inject_proxy_environment$ProxyConfig.inject_proxy_environment8   s4    
 &t';';'=>	 &&r   c                 z    SR                  U R                  U R                  U R                  U R                  5      $ )Nz3ProxyConfig(http={}, https={}, ftp={}, no_proxy={}))formatr   r   r   r   r   s    r   __str__ProxyConfig.__str__G   s.    DKKIItzz488T]]< 	<r    N)__name__
__module____qualname____firstlineno____doc__propertyr   r   r   r   staticmethodr    r+   r0   r4   __static_attributes__r6   r   r   r   r      sz         ! !   $ $ 
 
 '<r   r   N)utilsr   dictr   r6   r   r   <module>rA      s    %E<$ E<r   