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   úI/var/www/html/olx_land/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 )zòIs *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 )z«Force 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(   
ÿ
þù