From 6d6ef1e386e9c8cfe796e6d6aff762c4e616b1f7 Mon Sep 17 00:00:00 2001 From: meles5 Date: Fri, 30 Oct 2015 14:52:09 +0100 Subject: [PATCH] tox fixes --- MANIFEST.in | 1 + scripts/asciidoc2html.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1e7730676..8b987bac6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,6 +17,7 @@ include requirements.txt include tox.ini include qutebrowser.py +prune www prune scripts/dev exclude scripts/asciidoc2html.py exclude doc/notes diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index c1be2025d..05c03401e 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -77,6 +77,7 @@ class AsciiDoc: self._build_docs() def _build_docs(self): + """Build the documentation by rendering .asciidoc files to .html sites.""" files = self.FILES[:] for src in glob.glob('doc/help/*.asciidoc'): name, _ext = os.path.splitext(os.path.basename(src)) @@ -86,6 +87,7 @@ class AsciiDoc: self.call(src, dst) def _build_website(self): + """Prepare and build the website.""" theme_file = os.path.abspath(os.path.join('www', 'qute.css')) shutil.copy(theme_file, self._themedir) @@ -113,7 +115,7 @@ class AsciiDoc: outfp = io.StringIO() - with open(modified_src) as header_file: + with open(modified_src, 'r', encoding='utf-8') as header_file: header = header_file.read() header += "\n\n" @@ -149,12 +151,12 @@ class AsciiDoc: current_lines = outfp.getvalue() outfp.close() - with open(modified_src, "w+") as final_version: + with open(modified_src, 'w+', encoding='utf-8') as final_version: final_version.write(title + "\n\n" + header + current_lines) self.call(modified_src, dst, '--theme=qute') - copy = {'icons':'icons', 'doc/img':'doc/img', 'www/media':'media/'} + copy = {'icons': 'icons', 'doc/img': 'doc/img', 'www/media': 'media/'} for src, dest in copy.items(): shutil.copytree(src, os.path.join(outdir, dest))