o
    Df{                     @   sd   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
deeeedf ddf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 s"tdd |D s't } 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.
    )PROJ_CURL_CA_BUNDLECURL_CA_BUNDLESSL_CERT_FILEF Tc                 s   s    | ]}|t jv V  qd S N)osenviron).0env_var_name r   G/home/ubuntu/webapp/venv/lib/python3.10/site-packages/pyproj/network.py	<genexpr>2   s    

z%set_ca_bundle_path.<locals>.<genexpr>N)
isinstancestrr   anycertifiwherer   )r   env_var_namesr   r   r   set_ca_bundle_path   s   

r   r   )__doc__r   pathlibr   typingr   r   pyproj._networkr   r   r   r   boolr   r   r   r   r   <module>   s    $