
    ,hR                         d Z ddlZddlmZ ddlmZ ddlmZ  ej                  e	      5  ddl
ZddlZddlZddlZ G d dej                  j                         Zddd        G d	 d
e      Zy# 1 sw Y   xY w)zCdistutils.command.check

Implements the Distutils 'check' command.
    N)ClassVar   )Command)DistutilsSetupErrorc                   .     e Zd Z	 	 	 	 d fd	Zd Z xZS )SilentReporterc           	      >    g | _         t        | 	  |||||||       y N)messagessuper__init__)	selfsourcereport_level
halt_levelstreamdebugencodingerror_handler	__class__s	           e/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/_distutils/command/check.pyr   zSilentReporter.__init__   s(     DMGj&%=    c                     | j                   j                  ||||f       t        j                  j                  |g||| j
                  |   d|S )N)leveltype)r   appenddocutilsnodessystem_messagelevels)r   r   messagechildrenkwargss        r   r   zSilentReporter.system_message"   sZ    MM  %(F!CD>>00"*/dkk%6HLR r   )NFasciireplace)__name__
__module____qualname__r   r   __classcell__)r   s   @r   r   r      s     #		r   r   c                       e Zd ZU dZdZg dZeeee	e	e	f         e
d<   g dZeee	      e
d<   d Zd Zd	 Zd
 Zd Zd Zd Zy)checkz1This command checks the meta-data of the package.z"perform some checks on the package))metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check failsuser_options)r,   r.   r0   boolean_optionsc                 <    d| _         d| _        d| _        d| _        y)z Sets default values for options.F   r   N)r.   r,   r0   	_warningsr   s    r   initialize_optionszcheck.initialize_options9   s     %r   c                      y r
    r7   s    r   finalize_optionszcheck.finalize_options@   s    r   c                 X    | xj                   dz  c_         t        j                  | |      S )z*Counts the number of warnings that occurs.r5   )r6   r   warn)r   msgs     r   r=   z
check.warnC   s!    !||D#&&r   c                 V   | j                   r| j                          | j                  r5dt               v r	 | j	                          n| j                  rt        d      | j                  r| j                  dkD  rt        d      yy# t
        $ r}t        t        |            d}~ww xY w)zRuns the command.r   NzThe docutils package is needed.r   zPlease correct your package.)
r,   check_metadatar.   globalscheck_restructuredtext	TypeErrorr   strr0   r6   )r   excs     r   runz	check.runH   s     ==!  WY&8//1 )*KLL ;;4>>A-%&DEE .; ! 8-c#h778s   B 	B(B##B(c                     | j                   j                  }dD cg c]  }t        ||d      r| }}|r0| j                  dj	                  dj                  |                   yyc c}w )zEnsures that all required elements of meta-data are supplied.

        Required fields:
            name, version

        Warns if any are missing.
        )nameversionNzmissing required meta-data: {}z, )distributionr,   getattrr=   formatjoin)r   r,   attrmissings       r   r@   zcheck.check_metadata[   sm     $$-- 1
$PT8UD
 
 II6==dii>PQR 	
s
   A'A'c                     | j                   j                         }| j                  |      D ]:  }|d   j                  d      }||d   }n|d    d| d}| j	                  |       < y)z4Checks if the long string fields are reST-compliant.lineNr5   z (line ))rJ   get_long_description_check_rst_datagetr=   )r   datawarningrR   s       r   rB   zcheck.check_restructuredtextl   sr      557++D1 	G2;??6*D|!!*$QZLvQ7IIg	r   c           	      (   | j                   j                  xs d}t        j                  j                  j                         }t        j                  j                  t        j                  j                  j
                  f      j                         }d|_	        d|_
        d|_        t        ||j                  |j                  |j                  |j                   |j"                  |j$                        }t        j&                  j)                  |||      }|j+                  |d       	 |j-                  ||       |j2                  S # t.        t0        f$ r8}|j2                  j5                  dd| d	d
i f       Y d}~|j2                  S d}~ww xY w)z8Returns warnings when the provided data doesn't compile.zsetup.py)
components   N)r   r   r   r   )r   rQ   zCould not finish the parsing: . )rJ   script_namer   parsersrstParserfrontendOptionParserget_default_values	tab_widthpep_referencesrfc_referencesr   r   r   warning_streamr   error_encodingerror_encoding_error_handlerr   documentnote_sourceparseAttributeErrorrC   r   r   )r   rW   source_pathparsersettingsreporterrk   es           r   rU   zcheck._check_rst_dataw   st    ''33Az!!%%,,.$$11 ((,,335 2 



 	 "&"&!!!**..,,"??
 >>**8Xk*R["-	LLx(     	* 	$$015	&      	s   ,E
 
F#FFN)r&   r'   r(   __doc__descriptionr2   r   listtuplerD   __annotations__r3   r8   r;   r=   rF   r@   rB   rU   r:   r   r   r+   r+   )   sh    ;6K:L(4c3m 456  ,VOXd3i(U'
F&S"	!!r   r+   )rt   
contextlibtypingr   corer   errorsr   suppressImportErrordocutils.frontendr   docutils.nodesdocutils.parsers.rstdocutils.utilsutilsReporterr   r+   r:   r   r   <module>r      sm   
    (Z% 00 :o!G o!; s   0A//A8