
    -h                        d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ e G d d                      Z	e G d d                      Z
e G d	 d
                      ZddZdddZddZddZdS )    )annotationsN)	dataclass)metadatac                  *    e Zd ZU dZded<   	 ded<   dS )	_Variablez-Dataclass describing an environment variable.strnamevalueN__name__
__module____qualname____doc____annotations__     J/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/_griffe/debug.pyr   r      s-         77IIIJJJr   r   c                  *    e Zd ZU dZded<   	 ded<   dS )_Packagez&Dataclass describing a Python package.r   r	   versionNr   r   r   r   r   r      s-         00IIILLLr   r   c                  Z    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 ded<   	 d	ed
<   dS )_Environmentz+Dataclass to store environment information.r   interpreter_nameinterpreter_versioninterpreter_pathplatformzlist[_Package]packageszlist[_Variable]	variablesNr   r   r   r   r   r   $   sl         55"%$MMM  r   r   returntuple[str, str]c                    t          t          d          rjt          j        j        } | j         d| j         d| j         }| j        }|dk    r ||d         t          | j	                  z   z  }t          j        j
        |fS dS )Nimplementation.finalr   ) 0.0.0)hasattrsysr"   r   majorminormicroreleaselevelr   serialr	   )implr   kinds      r   _interpreter_name_versionr0   6   s    s$%% 0!)Z;;$*;;tz;; 7??tAwT[!1!111G!&//;r   griffedistr   c                X    	 t          j        |           S # t           j        $ r Y dS w xY w)zGet version of the given distribution.

    Parameters:
        dist: A distribution name.

    Returns:
        A version number.
    r&   )r   r   PackageNotFoundError)r2   s    r   _get_versionr5   A   s=    %%%(   wws    ))c            	         t                      \  } }dg}dgd t          j        D             }t          | |t          j        t          j                    fd|D             d |D                       S )zVGet debug/environment information.

    Returns:
        Environment information.
    r1   
PYTHONPATHc                <    g | ]}|                     d           |S )GRIFFE)
startswith).0vars     r   
<listcomp>z#_get_debug_info.<locals>.<listcomp>X   s)     W W WcnnX>V>V W W W Wr   c                \    g | ](}t          j        |          xt          |          )S r   )osgetenvr   )r;   r<   vals     r   r=   z#_get_debug_info.<locals>.<listcomp>^   s6    WWW3ryQT~~@UW9S#&&WWWr   c                H    g | ]}t          |t          |                     S r   )r   r5   )r;   pkgs     r   r=   z#_get_debug_info.<locals>.<listcomp>_   s*    GGGs(3S 1 122GGGr   )r   r   r   r   r   r   )r0   r?   environr   r(   
executabler   )py_name
py_versionr   r   rA   s       @r   _get_debug_inforH   P   s     455GZzHX W W
 W W WXI &"$$WWWW)WWWGGhGGG   r   Nonec            	        t                      } t          d| j                    t          d| j         d| j         d| j         d           t          d           | j        D ]"}t          d|j         d|j         d	           #t          d
           | j	        D ]!}t          d|j         d|j
                    "dS )z$Print debug/environment information.z- __System__: z- __Python__:  z ()z- __Environment variables__:z  - `z`: ``z- __Installed packages__:z` vN)rH   printr   r   r   r   r   r	   r
   r   r   )infor<   rC   s      r   _print_debug_inforP   c   s    D	
*4=
*
*+++	
g40
g
g43K
g
gtOd
g
g
ghhh	
()))~ 2 20ch00CI0001111	
%&&&} 2 20ch003;0011112 2r   )r   r    )r1   )r2   r   r   r   )r   r   )r   rI   )
__future__r   r?   r   r(   dataclassesr   	importlibr   r   r   r   r0   r5   rH   rP   r   r   r   <module>rT      sS   # " " " " " 				  



 ! ! ! ! ! !                       ! ! ! ! ! ! ! !"          &
2 
2 
2 
2 
2 
2r   