changeset 39489:4e4fae1dda5c

doc: use modern import style in runrst
author Yuya Nishihara <yuya@tcha.org>
date Thu, 06 Sep 2018 22:12:21 +0900
parents 15e8250a82da
children b6db2e80a9ce
files doc/runrst
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/doc/runrst	Sun Aug 26 22:18:09 2018 +0900
+++ b/doc/runrst	Thu Sep 06 22:12:21 2018 +0900
@@ -12,11 +12,14 @@
 where WRITER is the name of a Docutils writer such as 'html' or 'manpage'
 """
 
+from __future__ import absolute_import
+
 import sys
 try:
-    from docutils.parsers.rst import roles
-    from docutils.core import publish_cmdline
-    from docutils import nodes, utils
+    import docutils.core as core
+    import docutils.nodes as nodes
+    import docutils.utils as utils
+    import docutils.parsers.rst.roles as roles
 except ImportError:
     sys.stderr.write("abort: couldn't generate documentation: docutils "
                      "module is missing\n")
@@ -58,4 +61,4 @@
     writer = sys.argv[1]
     del sys.argv[1]
 
-    publish_cmdline(writer_name=writer)
+    core.publish_cmdline(writer_name=writer)