From: Armin Ronacher Date: Sat, 3 May 2008 23:11:14 +0000 (+0200) Subject: fixed template reloading X-Git-Tag: 2.0rc1~102 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4dc957872589b03cafaede018810cfc86eb8b4d1;p=jinja2.git fixed template reloading --HG-- branch : trunk --- diff --git a/jinja2/loaders.py b/jinja2/loaders.py index 45959a5..a63cdbf 100644 --- a/jinja2/loaders.py +++ b/jinja2/loaders.py @@ -53,7 +53,7 @@ class BaseLoader(object): mtime = getmtime(path) with file(path) as f: source = f.read().decode('utf-8') - return source, path, lambda: mtime != getmtime(path) + return source, path, lambda: mtime == getmtime(path) """ def get_source(self, environment, template): @@ -124,7 +124,7 @@ class FileSystemLoader(BaseLoader): finally: f.close() old = path.getmtime(filename) - return contents, filename, lambda: path.getmtime(filename) != old + return contents, filename, lambda: path.getmtime(filename) == old raise TemplateNotFound(template) @@ -164,7 +164,7 @@ class PackageLoader(BaseLoader): filename = self.provider.get_resource_filename(self.manager, p) mtime = path.getmtime(filename) def uptodate(): - return path.getmtime(filename) != mtime + return path.getmtime(filename) == mtime source = self.provider.get_resource_string(self.manager, p) return source.decode(self.encoding), filename, uptodate