From e9047961321d390edc834e08c8c72093b3fd608d Mon Sep 17 00:00:00 2001
From: Mike Bayer <mike_mp@zzzcomputing.com>
Date: Tue, 13 Jan 2009 01:32:52 +0000
Subject: [PATCH] - Added last_modified accessor to Template,   returns the
 time.time() when the module   was created. [ticket:97]

---
 CHANGES              | 5 +++++
 lib/mako/template.py | 6 +++++-
 setup.py             | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGES b/CHANGES
index 557b9ef..ab3eeef 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+0.2.5
+- Added last_modified accessor to Template,
+  returns the time.time() when the module
+  was created. [ticket:97]
+  
 0.2.4
 - Fixed compatibility with Jython 2.5b1.
 
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
diff --git a/setup.py b/setup.py
index 629760a..a3f125a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = '0.2.4'
+version = '0.2.5'
 
 setup(name='Mako',
       version=version,
-- 
GitLab