HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/docutils/writers/__pycache__/__init__.cpython-36.pyc
3

0+�W:�
@s�dZdZddlZddlZddlZddlmZmZddlm	Z	ej
dkrRddlmZGd	d
�d
e�Z
Gdd�de
�Zd
d
ddddddddd
dd�Zdd�ZdS)z0
This package contains Docutils Writer modules.
ZreStructuredText�N)�	languages�	Component)�	universal��)�
__import__c@sPeZdZdZdZdZdd�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.
    �writerZwriterscCstj|�tjtjtjgS)N)r�get_transformsrZMessagesZFilterMessagesZStripClassesAndElements)�self�r�/usr/lib/python3.6/__init__.pyr
$szWriter.get_transformsNcCs
i|_dS)N)�parts)rrrr
�__init__8szWriter.__init__cCs:||_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.writecCstd��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_partsbszWriter.assemble_parts)�__name__�
__module__�__qualname__�__doc__Zcomponent_typeZconfig_sectionr
rrrrrrrrrrrr
rs
	rc@seZdZdZdd�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!isr!Z	html4css1Zhtml5_polyglotZlatex2eZ	pseudoxmlZrlpdfZs5_htmlZxetexZdocutils_xml)ZhtmlZhtml4Zhtml5Zlatex�pprintZpformatZpdfZs5ZxelatexZxhtmlZxhtml10ZxmlcCs`|j�}|tkrt|}yt|t�t�dd�}Wn(tk
rXt|t�t�dd�}YnX|jS)z6Return the Writer class from the `writer_name` module.�)�levelr)�lower�_writer_aliasesr�globals�locals�ImportErrorr)Zwriter_name�modulerrr
�get_writer_class�sr+)rr)r Z
__docformat__Zos.path�os�sysrrrZdocutils.transformsr�version_infoZdocutils._compatrrr!r&r+rrrr
�<module>s.
T