File: //lib/python3.6/site-packages/docutils/writers/__pycache__/__init__.cpython-36.pyc
3
0+�W: �
@ s� d Z dZddlZddlZddlZddlmZmZ ddlm Z ej
dk rRddlmZ G d d
� d
e�Z
G dd� de
�Zd
d
ddddddddd
dd�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 j| �tjtjtjg S )N)r �get_transformsr ZMessagesZFilterMessagesZStripClassesAndElements)�self� r �/usr/lib/python3.6/__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: || _ 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.
)�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<