a DOg@sdZddlmZddlmZzHddlmZddlmZddl m Z ddl m Z Gdd d eZ d Z Wneyzd Z Yn0Gd d d eZdS)zCdistutils.command.check Implements the Distutils 'check' command. )Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc@seZdZd ddZddZdS) SilentReporterNrasciireplacec Cs"g|_t||||||||dSN)messagesr__init__)selfsource report_level halt_levelstreamdebugencoding error_handlerr}|dd}|dur8|d}nd|d|f}||qdS)z4Checks if the long string fields are reST-compliant.lineNr(z %s (line %s))r5Zget_long_description_check_rst_datagetr-)rdataZwarningr;rrrr1ps  zcheck.check_restructuredtextc Cs|jjp d}t}tjtfd}d|_d|_d|_t ||j |j |j |j |j|jd}tj|||d}||dz|||Wn<ty}z$|jdd|d ifWYd}~n d}~00|jS) z8Returns warnings when the provided data doesn't compile.zsetup.py)Z componentsN)rrrr)rr:z!Could not finish the parsing: %s.)r5Z script_namerrZ OptionParserZget_default_valuesZ tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZ note_sourceparseAttributeErrorr r)rr> source_pathparserZsettingsZreporterrAerrrr<{s.  zcheck._check_rst_dataN)rrr __doc__Z descriptionZ user_optionsZboolean_optionsr+r,r-r2r/r1r<rrrrr!#s! r!N)rGZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr0 Exceptionr!rrrrs