o
    LK&h	                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ ddl	m
Z
 ddlmZ ddlmZ d	d
 Zdd Zdd Zde
jfddZe jdd Zeedd Zeeddd  ede
jfddZdd ZdS )    N)	pass_none)yield_lines)consume   )metadata)ensure_unique)OptionErrorc              
   C   s@   z| j  W dS  ttfy } zd|  d}t||d}~ww )z
    Exercise one of the dynamic properties to trigger
    the pattern match.

    This function is deprecated in favor of importlib_metadata 8.7 and
    Python 3.14 importlib.metadata, which validates entry points on
    construction.
    zProblems to parse zq.
Please ensure entry-point follows the spec: https://packaging.python.org/en/latest/specifications/entry-points/N)extrasAttributeErrorAssertionErrorr   )epexmsg r   K/var/www/html/venv/lib/python3.10/site-packages/setuptools/_entry_points.pyensure_valid   s   	

r   c                 C   s*   t | }d| dd| }tj|S )zf
    Given a value of an entry point or series of entry points,
    return each as an EntryPoint.
    []

)r   joinr   EntryPoints
_from_text)valuegrouplinestextr   r   r   
load_group"   s   r   c                 C   s   | j | jfS N)r   name)r   r   r   r   by_group_and_name-   s   r   epsc                 C   s   t ttt| td | S )zM
    Ensure entry points are unique by group and name and validate each.
    key)r   mapr   r   r   r    r   r   r   validate1   s   r%   c                 C   s(   t jdd |  D }tt|S )zA
    Given a Distribution.entry_points, produce EntryPoints.
    c                 s   s    | ]
\}}t ||V  qd S r   )r   ).0r   r   r   r   r   	<genexpr>>   s    
zload.<locals>.<genexpr>)	itertoolschainfrom_iterableitemsr%   r   r   )r    groupsr   r   r   load9   s   r-   c                 C   s   t ttj| S )z
    >>> ep, = load('[console_scripts]\nfoo=bar')
    >>> ep.group
    'console_scripts'
    >>> ep.name
    'foo'
    >>> ep.value
    'bar'
    )r%   r   r   r   r$   r   r   r   _D   s   r.   c                 C   s   | S r   r   )xr   r   r   <lambda>R   s    r0   c                 C   s2   t d}tt| |d|}ddd |D S )Nr   r!   r   c                 s   s*    | ]\}}d | dt | dV  qdS )r   r   r   N)render_items)r&   r   r+   r   r   r   r'   Z   s   ( zrender.<locals>.<genexpr>)operator
attrgetterr(   groupbysortedr   )r    by_groupr,   r   r   r   renderU   s   
r7   c                 C   s   d dd t| D S )Nr   c                 s   s"    | ]}|j  d |j V  qdS )z = N)r   r   )r&   r   r   r   r   r'   ^   s     zrender_items.<locals>.<genexpr>)r   r5   r$   r   r   r   r1   ]   s   r1   )	functoolsr(   r2   jaraco.functoolsr   jaraco.textr   more_itertoolsr   
_importlibr   
_itertoolsr   errorsr   r   r   r   r   r%   singledispatchr-   registerstrr.   typer7   r1   r   r   r   r   <module>   s*    


