Skip to content
Myr

fixed template reloading

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 792c759 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:jinja2/loaders.py+3 added-3 removed
51 unmodified lines
52 raise TemplateNotFound(template)53 mtime = getmtime(path)54 with file(path) as f:55 source = f.read().decode('utf-8')56 return source, path, lambda: mtime != getmtime(path)56 return source, path, lambda: mtime == getmtime(path)57 """5859 def get_source(self, environment, template):60 """Get the template source, filename and reload helper for a template.
62 unmodified lines
123 contents = f.read().decode(self.encoding)124 finally:125 f.close()126 old = path.getmtime(filename)127 return contents, filename, lambda: path.getmtime(filename) != old127 return contents, filename, lambda: path.getmtime(filename) == old128 raise TemplateNotFound(template)129130131class PackageLoader(BaseLoader):
31 unmodified lines
163 if self.filesystem_bound:164 filename = self.provider.get_resource_filename(self.manager, p)165 mtime = path.getmtime(filename)166 def uptodate():167 return path.getmtime(filename) != mtime167 return path.getmtime(filename) == mtime168169 source = self.provider.get_resource_string(self.manager, p)170 return source.decode(self.encoding), filename, uptodate171
102 unmodified lines