o
    h	                     @   s   U d dl Zd dlZd dlZd dlmZmZmZ dedefddZ	dede
fdd	Zi Zeee
f ed
< dede
fddZdede
ddfddZdgg ddgdgdgdgdZeeee f ed< dS )    N)DictListTupleversionreturnc              	   C   sb   |  d}g }|D ]#}dtdd |}z	|t| W q	 ty,   Y  t|S w t|S )N. c                 S   s
   | t jv S )N)stringdigits)x r   @/var/www/html/venv/lib/python3.10/site-packages/dns/_features.py<lambda>   s   
 z"_tuple_from_text.<locals>.<lambda>)splitjoin	itertools	takewhileappendint	Exceptiontuple)r   
text_parts	int_parts	text_partdigit_prefixr   r   r   _tuple_from_text	   s   
r   requirementc                 C   sb   |  d\}}ztj|}|du rW dS W n
 ty    Y dS w t|}t|}||k r/dS dS )zeIs the requirement fulfilled?

    The requirement must be of the form

        package>=version
    z>=NFT)r   	importlibmetadatar   r   r   )r   packageminimumr   	t_version	t_minimumr   r   r   _version_check   s   	r#   _cachefeaturec                 C   s^   t | }|dur|S t| }|du rdt | < dS d}|D ]
}t|s(d} nq|t | < |S )zIs *feature* available?

    This tests if all optional packages needed for the
    feature are available and recent enough.

    Returns ``True`` if the feature is available,
    and ``False`` if it is not or if metadata is
    missing.
    NFT)r$   get_requirementsr#   )r%   valuerequirementsokr   r   r   r   have2   s   


r+   enabledc                 C   s   |t | < dS )zForce the status of *feature* to be *enabled*.

    This method is provided as a workaround for any cases
    where importlib.metadata is ineffective, or for testing.
    N)r$   )r%   r,   r   r   r   forceM   s   r-   zcryptography>=43)zhttpcore>=1.0.0zhttpx>=0.26.0z	h2>=4.1.0zaioquic>=1.0.0z	idna>=3.7z
trio>=0.23z
wmi>=1.5.1)dnssecdohdoqidnatriowmir'   )importlib.metadatar   r   r	   typingr   r   r   strr   boolr#   r$   __annotations__r+   r-   r'   r   r   r   r   <module>   s(   

