
from __future__ import absolute_import

from docutils.nodes import Text, paragraph

from sphinxcontrib.reviewbuilder.reviewbuilder import ReVIEWBuilder


# from japanesesupport.py
def trunc_whitespace(app, doctree, docname):
    for node in doctree.traverse(Text):
        if isinstance(node.parent, paragraph):
            newtext = node.astext()
            for c in "\n\r\t":
                newtext = newtext.replace(c, "")
            newtext = newtext.strip()
            node.parent.replace(node, Text(newtext))


def setup(app):
    app.add_builder(ReVIEWBuilder)
    app.connect("doctree-resolved", trunc_whitespace)


from __future__ import absolute_import

from docutils import nodes

from sphinxcontrib.reviewbuilder.reviewbuilder import ReVIEWBuilder


# from japanesesupport.py
def trunc_whitespace(app, doctree, docname):
    for node in doctree.traverse(nodes.Text):
        if isinstance(node.parent, nodes.paragraph):
            newtext = node.astext()
            for c in "\n\r\t":
                newtext = newtext.replace(c, "")
            newtext = newtext.strip()
            node.parent.replace(node, nodes.Text(newtext))


def setup(app):
    app.add_builder(ReVIEWBuilder)
    app.connect("doctree-resolved", trunc_whitespace)

Access docutils standard nodes through nodes.*
Access docutils standard nodes through nodes.*

  
  from __future__ import absolute_import
  
- from docutils.nodes import Text, paragraph
+ from docutils import nodes
  
  from sphinxcontrib.reviewbuilder.reviewbuilder import ReVIEWBuilder
  
  
  # from japanesesupport.py
  def trunc_whitespace(app, doctree, docname):
-     for node in doctree.traverse(Text):
+     for node in doctree.traverse(nodes.Text):
-         if isinstance(node.parent, paragraph):
+         if isinstance(node.parent, nodes.paragraph):
              newtext = node.astext()
              for c in "\n\r\t":
                  newtext = newtext.replace(c, "")
              newtext = newtext.strip()
-             node.parent.replace(node, Text(newtext))
+             node.parent.replace(node, nodes.Text(newtext))
  
  
  def setup(app):
      app.add_builder(ReVIEWBuilder)
      app.connect("doctree-resolved", trunc_whitespace)
  
Access docutils standard nodes through nodes.*
## Code Before:

from __future__ import absolute_import

from docutils.nodes import Text, paragraph

from sphinxcontrib.reviewbuilder.reviewbuilder import ReVIEWBuilder


# from japanesesupport.py
def trunc_whitespace(app, doctree, docname):
    for node in doctree.traverse(Text):
        if isinstance(node.parent, paragraph):
            newtext = node.astext()
            for c in "\n\r\t":
                newtext = newtext.replace(c, "")
            newtext = newtext.strip()
            node.parent.replace(node, Text(newtext))


def setup(app):
    app.add_builder(ReVIEWBuilder)
    app.connect("doctree-resolved", trunc_whitespace)

## Instruction:
Access docutils standard nodes through nodes.*
## Code After:

from __future__ import absolute_import

from docutils import nodes

from sphinxcontrib.reviewbuilder.reviewbuilder import ReVIEWBuilder


# from japanesesupport.py
def trunc_whitespace(app, doctree, docname):
    for node in doctree.traverse(nodes.Text):
        if isinstance(node.parent, nodes.paragraph):
            newtext = node.astext()
            for c in "\n\r\t":
                newtext = newtext.replace(c, "")
            newtext = newtext.strip()
            node.parent.replace(node, nodes.Text(newtext))


def setup(app):
    app.add_builder(ReVIEWBuilder)
    app.connect("doctree-resolved", trunc_whitespace)
