diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-02-26 11:45:22 +0900 |
---|---|---|
committer | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-04-09 14:59:46 +0900 |
commit | 9311577116505151413708316982192fb1b2e875 (patch) | |
tree | e2b30ab53677d4ea2fb90c6498550e6c75278298 /scripts | |
parent | 90d3882d2c8b3c3a02b798ba9d5aaaff1186868a (diff) |
html: add relpath()
more simply link path
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/html.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/html.py b/scripts/html.py index d7e4890..80842cc 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(self, path, frm): + return os.path.relpath("{}/{}".format(self.top(), path), frm) + def relpath_y2h(self, file, frm): return os.path.relpath(file.replace("yaml", "html").replace("projects", "html"), frm) @@ -183,11 +186,11 @@ class periject_html(base.base): html("td").print(subbody.text(os.path.basename(file).replace(".yaml", ""))) status = v.get_data("status") - summary.option({"href":os.path.relpath("{}/html/{}.html".format(self.top(), status), dir)}) + summary.option({"href":self.relpath("html/{}.html".format(status), dir)}) html("td").print(summary.text(status)) assignee = v.get_data("assignee") - summary.option({"href":os.path.relpath("{}/html/{}.html".format(self.top(), assignee), dir)}) + summary.option({"href":self.relpath("html/{}.html".format(assignee), dir)}) html("td").print(summary.text(assignee)) html("td").print(v.get_data("title")) @@ -287,9 +290,9 @@ class periject_html(base.base): with html("tr"): html("td").print(os.path.relpath(v.file, self.top())) html("td").print(html("a", {"target":"summary", - "href":os.path.relpath("{}/html/{}.html".format(self.top(), status), dir)}).text(status)) + "href":self.relpath("html/{}.html".format(status), dir)}).text(status)) html("td").print(html("a", {"target":"summary", - "href":os.path.relpath("{}/html/{}.html".format(self.top(), assignee), dir)}).text(assignee)) + "href":self.relpath("html/{}.html".format(assignee), dir)}).text(assignee)) html("td").print(v.get_data("key")) #-------------------- |