From 04905380b94b82b73b343e23e64d53393386d470 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 15 Mar 2020 21:17:05 +0530
Subject: begin using pathlib
---
scripts/asciidoc2html.py | 57 ++++++++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 26 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index ceac1ff41..58e5da249 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -19,6 +19,7 @@
# along with qutebrowser. If not, see .
"""Generate the html documentation based on the asciidoc files."""
+from typing import Optional, List, Tuple
import re
import os
@@ -30,11 +31,14 @@ import shutil
import tempfile
import argparse
import io
+import pathlib
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
from scripts import utils
+DOC_DIR = pathlib.Path("qutebrowser/html/doc")
+
class AsciiDoc:
@@ -42,24 +46,23 @@ class AsciiDoc:
FILES = ['faq', 'changelog', 'contributing', 'quickstart', 'userscripts']
- def __init__(self, asciidoc, website):
+ def __init__(self, asciidoc: pathlib.Path, website: pathlib.Path) -> None:
self._cmd = None
- self._asciidoc = asciidoc
- self._website = website
- self._homedir = None
- self._themedir = None
- self._tempdir = None
- self._failed = False
+ self._asciidoc: Optional[pathlib.Path] = asciidoc
+ self._website: list = website
+ self._homedir: Optional[pathlib.Path] = None
+ self._themedir: Optional[pathlib.Path] = None
+ self._tempdir: Optional[pathlib.Path] = None
+ self._failed: bool = False
def prepare(self):
"""Get the asciidoc command and create the homedir to use."""
self._cmd = self._get_asciidoc_cmd()
- self._homedir = tempfile.mkdtemp()
- self._themedir = os.path.join(
- self._homedir, '.asciidoc', 'themes', 'qute')
- self._tempdir = os.path.join(self._homedir, 'tmp')
- os.makedirs(self._tempdir)
- os.makedirs(self._themedir)
+ self._homedir = pathlib.Path(tempfile.mkdtemp())
+ self._themedir = self._homedir / '.asciidoc' / 'themes' / 'qute'
+ self._tempdir = self._homedir / 'tmp'
+ self._tempdir.mkdir(parents=True)
+ self._themedir.mkdir(parents=True)
def cleanup(self):
"""Clean up the temporary home directory for asciidoc."""
@@ -76,12 +79,11 @@ class AsciiDoc:
def _build_docs(self):
"""Render .asciidoc files to .html sites."""
- files = [('doc/{}.asciidoc'.format(f),
- 'qutebrowser/html/doc/{}.html'.format(f))
+ files: List[Tuple[pathlib.Path, pathlib.Path]] = [(pathlib.Path('doc/{}.asciidoc'.format(f)),
+ DOC_DIR / (f + ".html"))
for f in self.FILES]
- for src in glob.glob('doc/help/*.asciidoc'):
- name, _ext = os.path.splitext(os.path.basename(src))
- dst = 'qutebrowser/html/doc/{}.html'.format(name)
+ for src in pathlib.Path('doc/help/').glob('*.asciidoc'):
+ dst = DOC_DIR / (src.stem + ".html")
files.append((src, dst))
# patch image links to use local copy
@@ -94,8 +96,7 @@ class AsciiDoc:
asciidoc_args = ['-a', 'source-highlighter=pygments']
for src, dst in files:
- src_basename = os.path.basename(src)
- modified_src = os.path.join(self._tempdir, src_basename)
+ modified_src = self._tempdir / src.name
with open(modified_src, 'w', encoding='utf-8') as modified_f, \
open(src, 'r', encoding='utf-8') as f:
for line in f:
@@ -189,7 +190,8 @@ class AsciiDoc:
def _build_website(self):
"""Prepare and build the website."""
- theme_file = os.path.abspath(os.path.join('www', 'qute.css'))
+ #theme_file = os.path.abspath(os.path.join('www', 'qute.css'))
+ theme_file = (pathlib.Path('www') / 'qute.css').resolve()
shutil.copy(theme_file, self._themedir)
outdir = self._website[0]
@@ -243,7 +245,7 @@ class AsciiDoc:
raise FileNotFoundError
- def call(self, src, dst, *args):
+ def call(self, src: pathlib.Path, dst: pathlib.Path, *args):
"""Call asciidoc for the given files.
Args:
@@ -251,15 +253,18 @@ class AsciiDoc:
dst: The destination .html file, or None to auto-guess.
*args: Additional arguments passed to asciidoc.
"""
- print("Calling asciidoc for {}...".format(os.path.basename(src)))
+ #print("Calling asciidoc for {}...".format(os.path.basename(src)))
+ src = pathlib.Path(src)
+ dst = pathlib.Path(dst)
+ print("Calling asciidoc for {}...".format(src.name))
cmdline = self._cmd[:]
if dst is not None:
- cmdline += ['--out-file', dst]
+ cmdline += ['--out-file', str(dst)]
cmdline += args
- cmdline.append(src)
+ cmdline.append(str(src))
try:
env = os.environ.copy()
- env['HOME'] = self._homedir
+ env['HOME'] = str(self._homedir)
subprocess.run(cmdline, check=True, env=env)
except (subprocess.CalledProcessError, OSError) as e:
self._failed = True
--
cgit v1.2.3-54-g00ecf
From c77757125499369a68263e06292e682f4efe86f3 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 15 Mar 2020 21:38:30 +0530
Subject: finish _build_website()
---
scripts/asciidoc2html.py | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index 58e5da249..cd91f65c9 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -190,24 +190,20 @@ class AsciiDoc:
def _build_website(self):
"""Prepare and build the website."""
- #theme_file = os.path.abspath(os.path.join('www', 'qute.css'))
theme_file = (pathlib.Path('www') / 'qute.css').resolve()
shutil.copy(theme_file, self._themedir)
- outdir = self._website[0]
+ outdir = pathlib.Path(self._website[0])
- for root, _dirs, files in os.walk(os.getcwd()):
- for filename in files:
- basename, ext = os.path.splitext(filename)
- if (ext != '.asciidoc' or
- basename in ['header', 'OpenSans-License']):
- continue
- self._build_website_file(root, filename)
+ for item_path in pathlib.Path().rglob('*.asciidoc'):
+ if item_path.stem in ['header', 'OpenSans-License']:
+ continue
+ self._build_website_file(item_path.parent, item_path.name)
copy = {'icons': 'icons', 'doc/img': 'doc/img', 'www/media': 'media/'}
for src, dest in copy.items():
- full_dest = os.path.join(outdir, dest)
+ full_dest = outdir / dest
try:
shutil.rmtree(full_dest)
except FileNotFoundError:
@@ -216,9 +212,9 @@ class AsciiDoc:
for dst, link_name in [
('README.html', 'index.html'),
- (os.path.join('doc', 'quickstart.html'), 'quickstart.html')]:
+ ((pathlib.Path('doc') / 'quickstart.html'), 'quickstart.html')]:
try:
- os.symlink(dst, os.path.join(outdir, link_name))
+ (outdir / link_name).symlink_to(dst)
except FileExistsError:
pass
--
cgit v1.2.3-54-g00ecf
From e298992ec1b18c3fe516471a46f52b3a8c0bb174 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 15 Mar 2020 22:27:39 +0530
Subject: finish _build_website_file()
---
scripts/asciidoc2html.py | 49 ++++++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 22 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index cd91f65c9..fac0c4607 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -105,7 +105,7 @@ class AsciiDoc:
modified_f.write(line)
self.call(modified_src, dst, *asciidoc_args)
- def _copy_images(self):
+ def _copy_images(self) -> None:
"""Copy image files to qutebrowser/html/doc."""
print("Copying files...")
dst_path = os.path.join('qutebrowser', 'html', 'doc', 'img')
@@ -118,21 +118,29 @@ class AsciiDoc:
dst = os.path.join(dst_path, filename)
shutil.copy(src, dst)
- def _build_website_file(self, root, filename):
+ def _build_website_file(self, root: pathlib.Path, filename: str) -> None:
"""Build a single website file."""
- src = os.path.join(root, filename)
- src_basename = os.path.basename(src)
- parts = [self._website[0]]
- dirname = os.path.dirname(src)
- if dirname:
- parts.append(os.path.relpath(os.path.dirname(src)))
- parts.append(
- os.extsep.join((os.path.splitext(src_basename)[0],
- 'html')))
- dst = os.path.join(*parts)
- os.makedirs(os.path.dirname(dst), exist_ok=True)
-
- modified_src = os.path.join(self._tempdir, src_basename)
+ #src = os.path.join(root, filename)
+ src = root / filename
+ src_basename = src.name
+ dst = pathlib.Path(self._website[0])
+ #parts = [self._website[0]]
+ dirname = src.parent
+ dst = src.parent.relative_to('.') / (src.stem + ".html")
+ dst.parent.mkdir(exist_ok=True)
+
+ #if len(dirname.parents) > 0:
+ # parts.append(os.path.relpath(dirname))
+ #parts.append(os.extsep.join(src.stem, 'html')) #WHY CAN'T WE MAKE IT A SIMPLE +???
+
+ #parts.append(
+ # os.extsep.join((os.path.splitext(src_basename)[0],
+ # 'html')))
+ #dst = os.path.join(*parts)
+ #os.makedirs(os.path.dirname(dst), exist_ok=True)
+
+ #modified_src = os.path.join(self._tempdir, src.name)
+ modified_src = self._tempdir / src.name
shutil.copy('www/header.asciidoc', modified_src)
outfp = io.StringIO()
@@ -188,7 +196,7 @@ class AsciiDoc:
'-a', 'source-highlighter=pygments']
self.call(modified_src, dst, *asciidoc_args)
- def _build_website(self):
+ def _build_website(self) -> None:
"""Prepare and build the website."""
theme_file = (pathlib.Path('www') / 'qute.css').resolve()
shutil.copy(theme_file, self._themedir)
@@ -281,12 +289,9 @@ def parse_args():
return parser.parse_args()
-def run(**kwargs):
+def run(**kwargs) -> None:
"""Regenerate documentation."""
- try:
- os.mkdir('qutebrowser/html/doc')
- except FileExistsError:
- pass
+ DOC_DIR.mkdir(exist_ok=True)
asciidoc = AsciiDoc(**kwargs)
try:
@@ -303,7 +308,7 @@ def run(**kwargs):
asciidoc.cleanup()
-def main(colors=False):
+def main(colors: bool = False) -> None:
"""Generate html files for the online documentation."""
utils.change_cwd()
utils.use_color = colors
--
cgit v1.2.3-54-g00ecf
From 6fab7845f0ce3f77037d73a928fc2a973ddf12f5 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 15 Mar 2020 23:09:11 +0530
Subject: add pathlib to asciidoc2html script
---
scripts/asciidoc2html.py | 63 ++++++++++++++++++------------------------------
1 file changed, 24 insertions(+), 39 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index fac0c4607..ce00043fe 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -19,7 +19,7 @@
# along with qutebrowser. If not, see .
"""Generate the html documentation based on the asciidoc files."""
-from typing import Optional, List, Tuple
+from typing import List, Tuple
import re
import os
@@ -46,16 +46,20 @@ class AsciiDoc:
FILES = ['faq', 'changelog', 'contributing', 'quickstart', 'userscripts']
- def __init__(self, asciidoc: pathlib.Path, website: pathlib.Path) -> None:
+ def __init__(self, asciidoc, website) -> None:
+ """
+ asciidoc: Optional[List[str]]
+ website: Optional[List[str]])
+ """
self._cmd = None
- self._asciidoc: Optional[pathlib.Path] = asciidoc
- self._website: list = website
- self._homedir: Optional[pathlib.Path] = None
- self._themedir: Optional[pathlib.Path] = None
- self._tempdir: Optional[pathlib.Path] = None
- self._failed: bool = False
-
- def prepare(self):
+ self._asciidoc = asciidoc
+ self._website = website
+ self._homedir = None
+ self._themedir = None
+ self._tempdir = None
+ self._failed = False
+
+ def prepare(self) -> None:
"""Get the asciidoc command and create the homedir to use."""
self._cmd = self._get_asciidoc_cmd()
self._homedir = pathlib.Path(tempfile.mkdtemp())
@@ -64,12 +68,12 @@ class AsciiDoc:
self._tempdir.mkdir(parents=True)
self._themedir.mkdir(parents=True)
- def cleanup(self):
+ def cleanup(self) -> None:
"""Clean up the temporary home directory for asciidoc."""
if self._homedir is not None and not self._failed:
shutil.rmtree(self._homedir)
- def build(self):
+ def build(self) -> None:
"""Build either the website or the docs."""
if self._website:
self._build_website()
@@ -77,7 +81,7 @@ class AsciiDoc:
self._build_docs()
self._copy_images()
- def _build_docs(self):
+ def _build_docs(self) -> None:
"""Render .asciidoc files to .html sites."""
files: List[Tuple[pathlib.Path, pathlib.Path]] = [(pathlib.Path('doc/{}.asciidoc'.format(f)),
DOC_DIR / (f + ".html"))
@@ -108,38 +112,22 @@ class AsciiDoc:
def _copy_images(self) -> None:
"""Copy image files to qutebrowser/html/doc."""
print("Copying files...")
- dst_path = os.path.join('qutebrowser', 'html', 'doc', 'img')
- try:
- os.mkdir(dst_path)
- except FileExistsError:
- pass
+ dst_path = DOC_DIR / 'img'
+ dst_path.mkdir(exist_ok=True)
for filename in ['cheatsheet-big.png', 'cheatsheet-small.png']:
- src = os.path.join('doc', 'img', filename)
- dst = os.path.join(dst_path, filename)
+ src = pathlib.Path('doc') / 'img' / filename
+ dst = dst_path / filename
shutil.copy(src, dst)
def _build_website_file(self, root: pathlib.Path, filename: str) -> None:
"""Build a single website file."""
- #src = os.path.join(root, filename)
src = root / filename
src_basename = src.name
dst = pathlib.Path(self._website[0])
- #parts = [self._website[0]]
dirname = src.parent
dst = src.parent.relative_to('.') / (src.stem + ".html")
dst.parent.mkdir(exist_ok=True)
- #if len(dirname.parents) > 0:
- # parts.append(os.path.relpath(dirname))
- #parts.append(os.extsep.join(src.stem, 'html')) #WHY CAN'T WE MAKE IT A SIMPLE +???
-
- #parts.append(
- # os.extsep.join((os.path.splitext(src_basename)[0],
- # 'html')))
- #dst = os.path.join(*parts)
- #os.makedirs(os.path.dirname(dst), exist_ok=True)
-
- #modified_src = os.path.join(self._tempdir, src.name)
modified_src = self._tempdir / src.name
shutil.copy('www/header.asciidoc', modified_src)
@@ -222,11 +210,11 @@ class AsciiDoc:
('README.html', 'index.html'),
((pathlib.Path('doc') / 'quickstart.html'), 'quickstart.html')]:
try:
- (outdir / link_name).symlink_to(dst)
+ (outdir / link_name).symlink_to(dst) # mypy gives error here. Not sure why
except FileExistsError:
pass
- def _get_asciidoc_cmd(self):
+ def _get_asciidoc_cmd(self): # -> List[str]
"""Try to find out what commandline to use to invoke asciidoc."""
if self._asciidoc is not None:
return self._asciidoc
@@ -257,9 +245,6 @@ class AsciiDoc:
dst: The destination .html file, or None to auto-guess.
*args: Additional arguments passed to asciidoc.
"""
- #print("Calling asciidoc for {}...".format(os.path.basename(src)))
- src = pathlib.Path(src)
- dst = pathlib.Path(dst)
print("Calling asciidoc for {}...".format(src.name))
cmdline = self._cmd[:]
if dst is not None:
@@ -277,7 +262,7 @@ class AsciiDoc:
sys.exit(1)
-def parse_args():
+def parse_args() -> argparse.Namespace:
"""Parse command-line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument('--website', help="Build website into a given "
--
cgit v1.2.3-54-g00ecf
From 0d94278967b63630f7c50a719f765c636a1e7e44 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 19 Apr 2020 14:17:16 +0530
Subject: add type annotations to asciidoc2html script
---
scripts/asciidoc2html.py | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index ce00043fe..cf1d2b200 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -19,14 +19,12 @@
# along with qutebrowser. If not, see .
"""Generate the html documentation based on the asciidoc files."""
-from typing import List, Tuple
-
+from typing import List, Tuple, Optional
import re
import os
import os.path
import sys
import subprocess
-import glob
import shutil
import tempfile
import argparse
@@ -46,17 +44,15 @@ class AsciiDoc:
FILES = ['faq', 'changelog', 'contributing', 'quickstart', 'userscripts']
- def __init__(self, asciidoc, website) -> None:
- """
- asciidoc: Optional[List[str]]
- website: Optional[List[str]])
- """
- self._cmd = None
+ def __init__(self,
+ asciidoc: Optional[List[str]],
+ website: Optional[str]) -> None:
+ self._cmd = None # type: Optional[List[str]]
self._asciidoc = asciidoc
self._website = website
- self._homedir = None
- self._themedir = None
- self._tempdir = None
+ self._homedir = None # type: Optional[pathlib.Path]
+ self._themedir = None # type: Optional[pathlib.Path]
+ self._tempdir = None # type: Optional[pathlib.Path]
self._failed = False
def prepare(self) -> None:
@@ -83,9 +79,8 @@ class AsciiDoc:
def _build_docs(self) -> None:
"""Render .asciidoc files to .html sites."""
- files: List[Tuple[pathlib.Path, pathlib.Path]] = [(pathlib.Path('doc/{}.asciidoc'.format(f)),
- DOC_DIR / (f + ".html"))
- for f in self.FILES]
+ files = [(pathlib.Path('doc/{}.asciidoc'.format(f)),
+ DOC_DIR / (f + ".html")) for f in self.FILES]
for src in pathlib.Path('doc/help/').glob('*.asciidoc'):
dst = DOC_DIR / (src.stem + ".html")
files.append((src, dst))
@@ -100,6 +95,7 @@ class AsciiDoc:
asciidoc_args = ['-a', 'source-highlighter=pygments']
for src, dst in files:
+ assert self._tempdir is not None # for mypy
modified_src = self._tempdir / src.name
with open(modified_src, 'w', encoding='utf-8') as modified_f, \
open(src, 'r', encoding='utf-8') as f:
@@ -122,12 +118,12 @@ class AsciiDoc:
def _build_website_file(self, root: pathlib.Path, filename: str) -> None:
"""Build a single website file."""
src = root / filename
- src_basename = src.name
- dst = pathlib.Path(self._website[0])
- dirname = src.parent
+ assert self._website is not None # for mypy
+ dst = pathlib.Path(self._website)
dst = src.parent.relative_to('.') / (src.stem + ".html")
dst.parent.mkdir(exist_ok=True)
-
+
+ assert self._tempdir is not None # for mypy
modified_src = self._tempdir / src.name
shutil.copy('www/header.asciidoc', modified_src)
@@ -187,9 +183,11 @@ class AsciiDoc:
def _build_website(self) -> None:
"""Prepare and build the website."""
theme_file = (pathlib.Path('www') / 'qute.css').resolve()
+ assert self._themedir is not None # for mypy
shutil.copy(theme_file, self._themedir)
- outdir = pathlib.Path(self._website[0])
+ assert self._website is not None # for mypy
+ outdir = pathlib.Path(self._website)
for item_path in pathlib.Path().rglob('*.asciidoc'):
if item_path.stem in ['header', 'OpenSans-License']:
@@ -209,12 +207,13 @@ class AsciiDoc:
for dst, link_name in [
('README.html', 'index.html'),
((pathlib.Path('doc') / 'quickstart.html'), 'quickstart.html')]:
+ assert isinstance(dst, (str, pathlib.Path)) # for mypy
try:
- (outdir / link_name).symlink_to(dst) # mypy gives error here. Not sure why
+ (outdir / link_name).symlink_to(dst)
except FileExistsError:
pass
- def _get_asciidoc_cmd(self): # -> List[str]
+ def _get_asciidoc_cmd(self) -> List[str]:
"""Try to find out what commandline to use to invoke asciidoc."""
if self._asciidoc is not None:
return self._asciidoc
@@ -246,6 +245,7 @@ class AsciiDoc:
*args: Additional arguments passed to asciidoc.
"""
print("Calling asciidoc for {}...".format(src.name))
+ assert self._cmd is not None # for mypy
cmdline = self._cmd[:]
if dst is not None:
cmdline += ['--out-file', str(dst)]
@@ -266,7 +266,7 @@ def parse_args() -> argparse.Namespace:
"""Parse command-line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument('--website', help="Build website into a given "
- "directory.", nargs=1)
+ "directory.")
parser.add_argument('--asciidoc', help="Full path to python and "
"asciidoc.py. If not given, it's searched in PATH.",
nargs=2, required=False,
--
cgit v1.2.3-54-g00ecf
From 9914e448dc2362d88a40765360963133194563cd Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 19 Apr 2020 14:19:58 +0530
Subject: add blank line between module docstring and imports
---
scripts/asciidoc2html.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index cf1d2b200..e792792d9 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -19,6 +19,7 @@
# along with qutebrowser. If not, see .
"""Generate the html documentation based on the asciidoc files."""
+
from typing import List, Tuple, Optional
import re
import os
--
cgit v1.2.3-54-g00ecf
From 680d6ebb583bef77b9b28d0fede471a6efa0fdba Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Sun, 19 Apr 2020 17:04:36 +0530
Subject: fix pylint error
---
scripts/asciidoc2html.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index e792792d9..fea106979 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -81,7 +81,7 @@ class AsciiDoc:
def _build_docs(self) -> None:
"""Render .asciidoc files to .html sites."""
files = [(pathlib.Path('doc/{}.asciidoc'.format(f)),
- DOC_DIR / (f + ".html")) for f in self.FILES]
+ DOC_DIR / (f + ".html")) for f in self.FILES]
for src in pathlib.Path('doc/help/').glob('*.asciidoc'):
dst = DOC_DIR / (src.stem + ".html")
files.append((src, dst))
--
cgit v1.2.3-54-g00ecf
From fd9e0f19c6153ab04bc5940212294e96f805fe5c Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Mon, 20 Apr 2020 13:30:23 +0530
Subject: fix another pylint error
---
scripts/asciidoc2html.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index fea106979..90b94f014 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -20,7 +20,7 @@
"""Generate the html documentation based on the asciidoc files."""
-from typing import List, Tuple, Optional
+from typing import List, Optional
import re
import os
import os.path
@@ -207,7 +207,8 @@ class AsciiDoc:
for dst, link_name in [
('README.html', 'index.html'),
- ((pathlib.Path('doc') / 'quickstart.html'), 'quickstart.html')]:
+ ((pathlib.Path('doc') / 'quickstart.html'),
+ 'quickstart.html')]:
assert isinstance(dst, (str, pathlib.Path)) # for mypy
try:
(outdir / link_name).symlink_to(dst)
--
cgit v1.2.3-54-g00ecf
From 64ffce27f9348e14836528c0313d3048669a29c7 Mon Sep 17 00:00:00 2001
From: Julin S <48789920+ju-sh@users.noreply.github.com>
Date: Wed, 27 May 2020 11:12:45 +0530
Subject: fix error in asciidoc2html.py script
---
scripts/asciidoc2html.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index 90b94f014..2f64eac52 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -121,7 +121,7 @@ class AsciiDoc:
src = root / filename
assert self._website is not None # for mypy
dst = pathlib.Path(self._website)
- dst = src.parent.relative_to('.') / (src.stem + ".html")
+ dst = dst / src.parent.relative_to('.') / (src.stem + ".html")
dst.parent.mkdir(exist_ok=True)
assert self._tempdir is not None # for mypy
--
cgit v1.2.3-54-g00ecf