ó ½z]c@sƒdZdZddlZddlmZmZmZddlmZdefd„ƒYZ de fd „ƒYZ iZ d „Z dS( s0 This package contains Docutils Reader modules. treStructuredTextiÿÿÿÿN(tutilstparserst Component(t universaltReadercBsVeZdZdZdZd„Zd d d„Zd„Zd„Z d„Z d„Z RS( s9 Abstract base class for docutils Readers. Each reader module or package must export a subclass also called 'Reader'. The two steps of a Reader's responsibility are to read data from the source Input object and parse the data with the Parser object. Call `read()` to process a document. treadertreaderscCs#tj|ƒtjtjtjgS(N(Rtget_transformsRt DecorationstExposeInternalst StripComments(tself((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyR s cCsA||_|dkr+|r+|j|ƒnd|_d|_dS(s· Initialize the Reader instance. Several instance attributes are defined with dummy initial values. Subclasses may use these attributes as they wish. N(tparsertNonet set_parsertsourcetinput(R R t parser_name((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyt__init__&s    cCstj|ƒ}|ƒ|_dS(sSet `self.parser` by name.N(Rtget_parser_classR (R Rt parser_class((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyR<scCsJ||_|js||_n||_|jjƒ|_|jƒ|jS(N(RR tsettingstreadRtparsetdocument(R RR R((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyRAs     cCs=|jƒ|_}|jj|j|ƒd|_|_dS(s(Parse `self.input` into a document tree.N(t new_documentRR RRRtcurrent_sourcet current_line(R R((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyRJscCstj|jj|jƒ}|S(s8Create and return a new empty document tree (root node).(RRRt source_pathR(R R((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyRPsN( t__name__t __module__t__doc__tcomponent_typetconfig_sectionRRRRRRR(((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyRs    tReReadercBseZdZd„ZRS(s• A reader which rereads an existing document tree (e.g. a deserializer). Often used in conjunction with `writers.UnfilteredWriter`. cCs tj|ƒS(N(RR(R ((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyR_s(RRR R(((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyR#VscCs€|jƒ}|tkr%t|}ny"t|tƒtƒddƒ}Wn/tk rxt|tƒtƒddƒ}nX|jS(s6Return the Reader class from the `reader_name` module.tlevelii(tlowert_reader_aliasest __import__tglobalstlocalst ImportErrorR(t reader_nametmodule((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pytget_reader_classgs   " "( R t __docformat__tsystdocutilsRRRtdocutils.transformsRRR#R&R-(((s;/tmp/pip-build-kBFYxq/docutils/docutils/readers/__init__.pyts E