From 90d3882d2c8b3c3a02b798ba9d5aaaff1186868a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 26 Feb 2019 11:39:59 +0900 Subject: html: add relpath_y2h() more simply link path Signed-off-by: Kuninori Morimoto --- scripts/html.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/html.py b/scripts/html.py index 724b1d8..d7e4890 100755 --- a/scripts/html.py +++ b/scripts/html.py @@ -118,6 +118,9 @@ class periject_html(base.base): super().__init__() self.git = self.config("git-linux") + def relpath_y2h(self, file, frm): + return os.path.relpath(file.replace("yaml", "html").replace("projects", "html"), frm) + def git_title(self, id): return self.run("git -C {} log -1 {} --format=%s".format(self.git, id)) @@ -176,7 +179,7 @@ class periject_html(base.base): subbody = html("a", {"target":"subbody"}) summary = html("a", {"target":"summary"}) with html("tr"): - subbody.option({"href":os.path.relpath(file.replace("yaml", "html").replace("projects", "html"), dir)}) + subbody.option({"href":self.relpath_y2h(file, dir)}) html("td").print(subbody.text(os.path.basename(file).replace(".yaml", ""))) status = v.get_data("status") @@ -308,7 +311,7 @@ class periject_html(base.base): with html("tr"): html("td").print(item) html("td").print(html("a", {"href": - os.path.relpath(related_file.replace("projects", "html").replace("yaml", "html"), current_dir)}).text(rv.get_data("title"))) + self.relpath_y2h(related_file, current_dir)}).text(rv.get_data("title"))) #-------------------- # task_relation -- cgit v1.2.3