Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/docutils/writers/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/docutils/writers/__pycache__/__init__.cpython-35.pyc



0+�W:�@s�dZdZddlZddlZddlZddlmZmZddlm	Z	ej
d#kruddlmZGd	d
�d
e�Z
Gdd�de
�Zd
ddddddddddddddddddddddd iZd!d"�ZdS)$z0
This package contains Docutils Writer modules.
ZreStructuredText�N)�	languages�	Component)�	universal��)�
__import__c@sveZdZdZdZdZdd�ZdZdZdZ	dZ
dd�Zd	d
�Zdd�Z
d
d�ZdS)�Writera
    Abstract base class for docutils Writers.

    Each writer module or package must export a subclass also called 'Writer'.
    Each writer must support all standard node types listed in
    `docutils.nodes.node_class_names`.

    The `write()` method is the main entry point.
    �writerZwriterscCs#tj|�tjtjtjgS)N)r�get_transformsrZMessagesZFilterMessagesZStripClassesAndElements)�self�r�J/opt/alt/python35/lib/python3.5/site-packages/docutils/writers/__init__.pyr
$szWriter.get_transformsNcCs
i|_dS)N)�parts)rrrr
�__init__8s	zWriter.__init__cCsS||_tj|jj|j�|_||_|j�|jj	|j
�}|S)a/
        Process a document into its final form.

        Translate `document` (a Docutils document tree) into the Writer's
        native format, and write it out to its `destination` (a
        `docutils.io.Output` subclass object).

        Normally not overridden or extended in subclasses.
        )�documentrZget_language�settingsZ
language_codeZreporter�language�destination�	translate�write�output)rrrrrrr
rAs
			
zWriter.writecCstd��dS)a
        Do final translation of `self.document` into `self.output`.  Called
        from `write`.  Override in subclasses.

        Usually done with a `docutils.nodes.NodeVisitor` subclass, in
        combination with a call to `docutils.nodes.Node.walk()` or
        `docutils.nodes.Node.walkabout()`.  The ``NodeVisitor`` subclass must
        support all standard elements (listed in
        `docutils.nodes.node_class_names`) and possibly non-standard elements
        used by the current Reader as well.
        z"subclass must override this methodN)�NotImplementedError)rrrr
rTszWriter.translatecCs:|j|jd<|jjj|jd<tj|jd<dS)z<Assemble the `self.parts` dictionary.  Extend in subclasses.Zwhole�encoding�versionN)rrrrZoutput_encoding�docutils�__version__)rrrr
�assemble_partsbszWriter.assemble_parts)�__name__�
__module__�__qualname__�__doc__Zcomponent_typeZconfig_sectionr
rrrrrrrrrrrr
rs
	rc@s"eZdZdZdd�ZdS)�UnfilteredWriterz�
    A writer that passes the document tree on unchanged (e.g. a
    serializer.)

    Documents written by UnfilteredWriters are typically reused at a
    later date using a subclass of `readers.ReReader`.
    cCs
tj|�S)N)rr
)rrrr
r
sszUnfilteredWriter.get_transformsN)rrrr r
rrrr
r!isr!ZhtmlZ	html4css1Zhtml4Zhtml5Zhtml5_polyglotZlatexZlatex2e�pprintZ	pseudoxml�pformatZpdfZrlpdfZs5Zs5_htmlZxelatexZxetexZxhtmlZxhtml10ZxmlZdocutils_xmlcCs~|j�}|tkr"t|}y"t|t�t�dd�}Wn0tk
rvt|t�t�dd�}YnX|jS)z6Return the Writer class from the `writer_name` module.�level�r)�lower�_writer_aliasesr�globals�locals�ImportErrorr)Zwriter_name�modulerrr
�get_writer_class�s
"
#r,)rr)r Z
__docformat__�os.path�os�sysrrrZdocutils.transformsr�version_infoZdocutils._compatrrr!r'r,rrrr
�<module>s.T