Fix lint.

This commit is contained in:
Florian Bruhin 2015-11-17 20:10:53 +01:00
parent fbe5eb4671
commit 0ccd19f980

View File

@ -77,7 +77,7 @@ class AsciiDoc:
self._build_docs()
def _build_docs(self):
"""Build the documentation by rendering .asciidoc files to .html sites."""
"""Render .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,21 +86,13 @@ class AsciiDoc:
for src, dst in files:
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)
outdir = self._args.website[0]
for root, _dirs, files in os.walk(os.getcwd()):
for filename in files:
if os.path.splitext(filename)[1] != '.asciidoc':
continue
def _build_website_file(self, root, filename):
"""Build a single website file."""
# pylint: disable=too-many-locals
src = os.path.join(root, filename)
src_basename = os.path.basename(src)
parts = [outdir]
parts = [self._args.website[0]]
dirname = os.path.dirname(src)
if dirname:
parts.append(os.path.relpath(os.path.dirname(src)))
@ -156,6 +148,19 @@ class AsciiDoc:
self.call(modified_src, dst, '--theme=qute')
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)
outdir = self._args.website[0]
for root, _dirs, files in os.walk(os.getcwd()):
for filename in files:
if os.path.splitext(filename)[1] != '.asciidoc':
continue
self._build_website_file(root, filename)
copy = {'icons': 'icons', 'doc/img': 'doc/img', 'www/media': 'media/'}
for src, dest in copy.items():