a
    ‘1$e{  ã                   @   sb   d Z ddlZddlmZ ddlmZ ddlZddlmZm	Z	m
Z
 d	eeeedf ddœdd„ZdS )
z0
Module for managing the PROJ network settings.
é    N)ÚPath)ÚUnion)Ú_set_ca_bundle_pathÚis_network_enabledÚset_network_enabled)Úca_bundle_pathÚreturnc                 C   s^   d}| du rd} n@t | ttfƒr*t| ƒ} n(| du sDtdd„ |D ƒƒsNt ¡ } nd} t| ƒ dS )a%  
    .. versionadded:: 3.0.0

    Sets the path to the CA Bundle used by the `curl`
    built into PROJ when PROJ network is enabled.

    See: :c:func:`proj_context_set_ca_bundle_path`

    Environment variables:

    - PROJ_CURL_CA_BUNDLE
    - CURL_CA_BUNDLE
    - SSL_CERT_FILE

    Parameters
    ----------
    ca_bundle_path: Union[Path, str, bool, None], optional
        Default is None, which only uses the `certifi` package path as a fallback if
        the environment variables are not set. If a path is passed in, then
        that will be the path used. If it is set to True, then it will default
        to using the path provided, by the `certifi` package. If it is set to False
        or an empty string then it will default to the system settings or environment
        variables.
    )ZPROJ_CURL_CA_BUNDLEÚCURL_CA_BUNDLEZSSL_CERT_FILEFÚ Tc                 s   s   | ]}|t jv V  qd S )N)ÚosÚenviron)Ú.0Zenv_var_name© r   úJ/var/www/html/django/DPS/env/lib/python3.9/site-packages/pyproj/network.pyÚ	<genexpr>2   s   z%set_ca_bundle_path.<locals>.<genexpr>N)Ú
isinstanceÚstrr   ÚanyÚcertifiÚwherer   )r   Zenv_var_namesr   r   r   Úset_ca_bundle_path   s    
ÿ
r   )N)Ú__doc__r   Úpathlibr   Útypingr   r   Zpyproj._networkr   r   r   r   Úboolr   r   r   r   r   Ú<module>   s   