Your IP : 216.73.216.85
B
0+�W: �
@ s� d Z dZddlZddlZddlZddlmZmZ ddlm Z ej
dk rRddlmZ G dd � d e�Z
G d
d� de
�Zddd
ddddddd
ddd�Zdd� ZdS )z0
This package contains Docutils Writer modules.
ZreStructuredText� N)� languages� Component)� universal)� � )�
__import__c @ sP e Zd ZdZdZdZdd� ZdZdZdZ dZ
dd� Zd d
� Zdd� 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.
�writerZwritersc C s t �| �tjtjtjg S )N)r �get_transformsr ZMessagesZFilterMessagesZStripClassesAndElements)�self� r �J/opt/alt/python37/lib/python3.7/site-packages/docutils/writers/__init__.pyr
$ s zWriter.get_transformsNc C s
i | _ d S )N)�parts)r r r r
�__init__8 s zWriter.__init__c C s: || _ t�|jj|j�| _|| _| �� | j� | 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.
)�documentr Zget_language�settingsZ
language_codeZreporter�language�destination� translate�write�output)r r r r r r r
r A s
zWriter.writec C s t d��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)r r r r
r T s zWriter.translatec C s, | j | jd<