diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-04-13 11:27:32 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-05-05 15:15:07 -0700 |
commit | 11e4950c91505368ff90eb561eb5a3eec5d2502a (patch) | |
tree | 37206f6b1387c9d1e6b2222f58227ce76341e9b0 /framework | |
parent | fe703e518510f24cc1da78eab249a152b9f66701 (diff) |
python: Make mako template dirs robust
This puts the templates in a directory structure that makes them robust
to both changes in python version and mako version.
This fixes errors caused by downgrading mako, which isn't that common,
unless you're running the unit tests with use the oldest supported mako,
and may conflict with the compiled templates from the system mako.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/summary/html_.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/framework/summary/html_.py b/framework/summary/html_.py index 676fa1a8a..80bee82e0 100644 --- a/framework/summary/html_.py +++ b/framework/summary/html_.py @@ -25,13 +25,14 @@ from __future__ import ( absolute_import, division, print_function, unicode_literals ) +import errno +import getpass import os import shutil -import tempfile -import getpass import sys -import errno +import tempfile +import mako from mako.lookup import TemplateLookup import six @@ -49,8 +50,11 @@ __all__ = [ _TEMP_DIR = os.path.join( tempfile.gettempdir(), - "piglit-{}".format(getpass.getuser()), - 'version-{}'.format(sys.version.split()[0])) + getpass.getuser(), + 'python-{}'.format(sys.version.split()[0]), + 'mako-{}'.format(mako.__version__), + 'summary', + 'html') _TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), '../..', 'templates') |