equal
deleted
inserted
replaced
309 |
309 |
310 def load(self, t): |
310 def load(self, t): |
311 '''Get the template for the given template name. Use a local cache.''' |
311 '''Get the template for the given template name. Use a local cache.''' |
312 if not t in self.cache: |
312 if not t in self.cache: |
313 try: |
313 try: |
314 self.cache[t] = open(self.map[t][1]).read() |
314 self.cache[t] = util.readfile(self.map[t][1]) |
315 except KeyError, inst: |
315 except KeyError, inst: |
316 raise util.Abort(_('"%s" not in template map') % inst.args[0]) |
316 raise util.Abort(_('"%s" not in template map') % inst.args[0]) |
317 except IOError, inst: |
317 except IOError, inst: |
318 raise IOError(inst.args[0], _('template file %s: %s') % |
318 raise IOError(inst.args[0], _('template file %s: %s') % |
319 (self.map[t][1], inst.args[1])) |
319 (self.map[t][1], inst.args[1])) |