o
    ó·i	  ã                   @   sl   d Z ddlZddlmZ ddlmZ ddlmZm	Z	 ddl
Z
ddlmZ G dd	„ d	eƒZG d
d„ deƒZdS )zH
Customized Mixin2to3 support:

 - adds support for converting doctests
é    N)Ú	Mixin2to3)Úlog)ÚRefactoringToolÚget_fixers_from_packageé   )ÚSetuptoolsDeprecationWarningc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚDistutilsRefactoringToolc                 O   ó   t j|g|¢R Ž  d S ©N)r   Úerror)ÚselfÚmsgÚargsÚkw© r   ú[C:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\setuptools/lib2to3_ex.pyÚ	log_error   ó   z"DistutilsRefactoringTool.log_errorc                 G   r	   r
   )r   Úinfo©r   r   r   r   r   r   Úlog_message   r   z$DistutilsRefactoringTool.log_messagec                 G   r	   r
   )r   Údebugr   r   r   r   Ú	log_debug   r   z"DistutilsRefactoringTool.log_debugN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r      s    r   c                   @   s&   e Zd Zd	dd„Zdd„ Zdd„ ZdS )
r   Fc                 C   s„   | j jdurd S |sd S t dt¡ t dd |¡ ¡ |  ¡  |  	¡  |r:t
jr8t| jƒ}|j|ddd� d S d S t | |¡ d S )NTz¥2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process.zFixing ú )ÚwriteZdoctests_only)ÚdistributionZuse_2to3ÚwarningsÚwarnr   r   r   ÚjoinÚ_Mixin2to3__build_fixer_namesÚ_Mixin2to3__exclude_fixersÚ
setuptoolsZrun_2to3_on_doctestsr   Úfixer_namesÚrefactorÚ
_Mixin2to3Úrun_2to3)r   ÚfilesZdoctestsÚrr   r   r   r(      s"   û
þzMixin2to3.run_2to3c                 C   s^   | j rd S g | _ tjD ]
}| j  t|ƒ¡ q| jjd ur+| jjD ]}| j  t|ƒ¡ q d S d S r
   )r%   r$   Zlib2to3_fixer_packagesÚextendr   r   Zuse_2to3_fixers)r   Úpr   r   r   Z__build_fixer_names4   s   
þzMixin2to3.__build_fixer_namesc                 C   sJ   t | dg ƒ}| jjd ur| | jj¡ |D ]}|| jv r"| j |¡ qd S )NZexclude_fixers)Úgetattrr   Zuse_2to3_exclude_fixersr+   r%   Úremove)r   Zexcluded_fixersZ
fixer_namer   r   r   Z__exclude_fixers>   s   
€þzMixin2to3.__exclude_fixersN)F)r   r   r   r(   r"   r#   r   r   r   r   r      s    

r   )Ú__doc__r   Údistutils.utilr   r'   Ú	distutilsr   Úlib2to3.refactorr   r   r$   Z_deprecation_warningr   r   r   r   r   r   Ú<module>   s    