aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-01-13 01:32:52 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-01-13 01:32:52 +0000
commite9047961321d390edc834e08c8c72093b3fd608d (patch)
tree1c2e7864ac97f8ccc7b7731aee685d980a387067 /lib
parent15a31f0429f11a80f668eb24da6334ca6ef7d3d4 (diff)
downloadexternal_python_mako-e9047961321d390edc834e08c8c72093b3fd608d.tar.gz
external_python_mako-e9047961321d390edc834e08c8c72093b3fd608d.tar.bz2
external_python_mako-e9047961321d390edc834e08c8c72093b3fd608d.zip
- Added last_modified accessor to Template,
returns the time.time() when the module was created. [ticket:97]
Diffstat (limited to 'lib')
-rw-r--r--lib/mako/template.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mako/template.py b/lib/mako/template.py
index 13823ea..03194a3 100644
--- a/lib/mako/template.py
+++ b/lib/mako/template.py
@@ -152,7 +152,10 @@ class Template(object):
"""return a def of this template as an individual Template of its own."""
return DefTemplate(self, getattr(self.module, "render_%s" % name))
-
+ def last_modified(self):
+ return self.module._modified_time
+ last_modified = property(last_modified)
+
class ModuleTemplate(Template):
"""A Template which is constructed given an existing Python module.
@@ -202,6 +205,7 @@ class DefTemplate(Template):
self.parent = parent
self.callable_ = callable_
self.output_encoding = parent.output_encoding
+ self.module = parent.module
self.encoding_errors = parent.encoding_errors
self.format_exceptions = parent.format_exceptions
self.error_handler = parent.error_handler