[Checkins] SVN: five.pt/trunk/ Patch 'macros' attribute.

Malthe Borch mborch at gmail.com
Thu Apr 16 05:38:23 EDT 2009


Log message for revision 99209:
  Patch 'macros' attribute.

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/src/five/pt/patches.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2009-04-16 09:34:37 UTC (rev 99208)
+++ five.pt/trunk/CHANGES.txt	2009-04-16 09:38:22 UTC (rev 99209)
@@ -1,9 +1,9 @@
 Changelog
 =========
 
-0.7 - unreleased
-~~~~~~~~~~~~~~~~
+In next release
 
+- Patch ``macros`` attribute. [malthe]
 
 0.6 - 2009-04-06
 ~~~~~~~~~~~~~~~~

Modified: five.pt/trunk/src/five/pt/patches.py
===================================================================
--- five.pt/trunk/src/five/pt/patches.py	2009-04-16 09:34:37 UTC (rev 99208)
+++ five.pt/trunk/src/five/pt/patches.py	2009-04-16 09:38:22 UTC (rev 99209)
@@ -70,6 +70,14 @@
 
     return template(self, *args, **kw)
 
+def get_macros(self):
+    template = getattr(self, '_template', _marker)
+    if template is _marker:
+        self._template = template = BaseTemplateFile(self.filename)
+
+    return template.__of__(self).macros
+
 FiveViewPageTemplateFile.__get__ = get_bound_template
 ZopeViewPageTemplateFile.__get__ = get_bound_template
 PageTemplateFile.__call__ = call_template
+PageTemplateFile.macros = property(get_macros)



More information about the Checkins mailing list