From 152720745751032bd2c21d00dd81239b2f7cb5f4 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 19 Feb 2012 14:55:14 +0100 Subject: g-ir-doctool: Use template caching --- giscanner/mallardwriter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index 2fa38176..b54d587b 100644 --- a/giscanner/mallardwriter.py +++ b/giscanner/mallardwriter.py @@ -23,6 +23,7 @@ import os import re +import tempfile from xml.sax import saxutils from mako.template import Template @@ -162,7 +163,9 @@ class MallardWriter(object): template_dir = 'unimplemented' file_name = os.path.join(template_dir, template_name) - template = Template(filename=file_name, output_encoding='utf-8') + file_name = os.path.abspath(file_name) + template = Template(filename=file_name, output_encoding='utf-8', + module_directory=tempfile.gettempdir()) if self._language == 'C': formatter = MallardFormatterC elif self._language == 'Python': -- cgit v1.2.1