B YI~d@sddlmZddlmZyTddlmZddlmZddlm Z ddlm Z ddl m Z Gdd d eZ d ZWnek rd ZYnXGd d d eZdS))Command)DistutilsSetupError)Reporter)Parser)frontend)nodes)StringIOc@seZdZd ddZddZdS) SilentReporterNrasciireplacec Cs"g|_t||||||||dS)N)messagesr__init__)selfsource report_level halt_levelstreamdebugencoding error_handlerr}|dd}|dkr:|d}nd|d|f}||qWdS)Nliner(z %s (line %s))r4Zget_long_description_check_rst_datagetr,)rdataZwarningr;rrrr0ns  zcheck.check_restructuredtextc Cs|jjp d}t}tjtfd}d|_d|_d|_t ||j |j |j |j |j|jd}tj|||d}||dy|||Wn:tk r}z|jdd|difWdd}~XYnX|jS) Nzsetup.py)Z components)rrrr)rr:z!Could not finish the parsing: %s.)r4Z script_namerrZ OptionParserZget_default_valuesZ tab_widthZpep_referencesZrfc_referencesr rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZ note_sourceparseAttributeErrorr r)rr> source_pathparserZsettingsZreporterrAerrrr<ys*   $zcheck._check_rst_dataN) rrr descriptionZ user_optionsZboolean_optionsr*r+r,r1r.r0r<rrrrr!$s  r!N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrriorr r/ Exceptionr!rrrrs