3

Q'ícÝã@sXdZddlmZddlmZddlmZmZddl	Z	Gdd„deƒZ
Gdd	„d	eƒZdS)
zy
Customized Mixin2to3 support:

 - adds support for converting doctests


This module raises an ImportError on Python 2.
é)Ú	Mixin2to3)Úlog)ÚRefactoringToolÚget_fixers_from_packageNc@s$eZdZdd„Zdd„Zdd„ZdS)ÚDistutilsRefactoringToolcOstj|f|žŽdS)N)rÚerror)ÚselfÚmsgÚargsÚkw©rú;/tmp/pip-build-l_bcah40/setuptools/setuptools/lib2to3_ex.pyÚ	log_errorsz"DistutilsRefactoringTool.log_errorcGstj|f|žŽdS)N)rÚinfo)rr	r
rrr
Úlog_messagesz$DistutilsRefactoringTool.log_messagecGstj|f|žŽdS)N)rÚdebug)rr	r
rrr
Ú	log_debugsz"DistutilsRefactoringTool.log_debugN)Ú__name__Ú
__module__Ú__qualname__rrrrrrr
rsrc@s&eZdZd	dd„Zdd„Zdd„ZdS)
rFcCsr|jjdk	rdS|sdStjddj|ƒƒ|jƒ|jƒ|rbtjrnt	|j
ƒ}|j|dddntj
||ƒdS)NTzFixing ú )ÚwriteZ
doctests_only)ÚdistributionZuse_2to3rrÚjoinÚ_Mixin2to3__build_fixer_namesÚ_Mixin2to3__exclude_fixersÚ
setuptoolsZrun_2to3_on_doctestsrÚfixer_namesÚrefactorÚ
_Mixin2to3Úrun_2to3)rÚfilesZdoctestsÚrrrr
r s
zMixin2to3.run_2to3cCsb|jr
dSg|_xtjD]}|jjt|ƒƒqW|jjdk	r^x |jjD]}|jjt|ƒƒqFWdS)N)rrZlib2to3_fixer_packagesÚextendrrZuse_2to3_fixers)rÚprrr
Z__build_fixer_names.szMixin2to3.__build_fixer_namescCsNt|dgƒ}|jjdk	r&|j|jjƒx"|D]}||jkr,|jj|ƒq,WdS)NZexclude_fixers)ÚgetattrrZuse_2to3_exclude_fixersr#rÚremove)rZexcluded_fixersZ
fixer_namerrr
Z__exclude_fixers8s

zMixin2to3.__exclude_fixersN)F)rrrr rrrrrr
rs

r)Ú__doc__Údistutils.utilrrÚ	distutilsrÚlib2to3.refactorrrrrrrrr
Ú<module>s