diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2018-02-13 11:21:18 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2018-02-13 11:21:51 +0000 |
commit | f761ab9f31f2779e0a1dcad76752f0031cf56d16 (patch) | |
tree | ed2709e4d1627753cf04c55bddfd83893b5992ae | |
parent | cb99a64d1aea1bc3908e0f8bbe1e3e5976ebc83d (diff) |
plans: fix path to 'templates' for rendering test plan
Use absolute path when resolving location of 'templates' directory for
rendering test plan to HTML
Change-Id: I02a057b9c6f9a4081a554050470d13aef2b46533
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rw-r--r-- | plans/testplan2html.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plans/testplan2html.py b/plans/testplan2html.py index 39bf7cbb..4b4e180b 100644 --- a/plans/testplan2html.py +++ b/plans/testplan2html.py @@ -9,7 +9,8 @@ from jinja2 import Environment, FileSystemLoader def render(obj, template="testplan.html", name=None): if name is None: name = template - _env = Environment(loader=FileSystemLoader('templates')) + templates_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") + _env = Environment(loader=FileSystemLoader(templates_dir)) _template = _env.get_template(template) _obj = _template.render(obj=obj) with open("{}".format(name), "wb") as _file: |