diff options
| author | JensDiemer <git@jensdiemer.de> | 2020-01-19 11:14:00 +0100 |
|---|---|---|
| committer | JensDiemer <git@jensdiemer.de> | 2020-01-19 11:14:00 +0100 |
| commit | 51a92cd75319bdef124d802cd23da0d32b11528b (patch) | |
| tree | 90366fac5856d5fd5f254971b57dddc6aefffb1a /creole/rest_tools | |
| parent | fe67bd6e548cec18fb6f56bc0b9557aa347cf131 (diff) | |
| download | creole-cleanup.tar.gz | |
fix code stylecleanup
Diffstat (limited to 'creole/rest_tools')
| -rw-r--r-- | creole/rest_tools/clean_writer.py | 6 | ||||
| -rw-r--r-- | creole/rest_tools/pypi_rest2html.py | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/creole/rest_tools/clean_writer.py b/creole/rest_tools/clean_writer.py index c9b9923..3798c50 100644 --- a/creole/rest_tools/clean_writer.py +++ b/creole/rest_tools/clean_writer.py @@ -124,9 +124,9 @@ class CleanHTMLTranslator(html4css1.HTMLTranslator, object): # set only html_body, we used in rest2html() and don't surround it with <div> def depart_document(self, node): - self.html_body.extend(self.body_prefix[1:] + self.body_pre_docinfo - + self.docinfo + self.body - + self.body_suffix[:-1]) + self.html_body.extend( + self.body_prefix[1:] + self.body_pre_docinfo + self.docinfo + self.body + self.body_suffix[:-1] + ) assert not self.context, 'len(context) = %s' % len(self.context) # __________________________________________________________________________ diff --git a/creole/rest_tools/pypi_rest2html.py b/creole/rest_tools/pypi_rest2html.py index 4f86640..b264514 100644 --- a/creole/rest_tools/pypi_rest2html.py +++ b/creole/rest_tools/pypi_rest2html.py @@ -12,21 +12,15 @@ """ -try: - # Python 3 - from urllib.parse import urlparse -except ImportError: - # Python 2 - from urlparse import urlparse +from urllib.parse import urlparse from creole.exceptions import DocutilsImportError try: - import docutils + import docutils # noqa flake8 from docutils import io, readers from docutils.core import publish_doctree, Publisher - from docutils.writers import get_writer_class - from docutils.transforms import TransformError, Transform + from docutils.transforms import TransformError except ImportError as err: msg = ( "%s - You can't use rest2html!" |
