Mercurial > p > roundup > code
diff roundup/cgi/PageTemplates/PageTemplate.py @ 1204:b862bbf2067a
Replaced the content() callback ickiness with Page Template macro usage
changed the default CSS style to be less offensive to some ;)
better handling of Page Template compilation errors
removed dependency on ComputedAttribute
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 25 Sep 2002 02:10:25 +0000 |
| parents | c08b3820edd1 |
| children | fc52d57c6c3e |
line wrap: on
line diff
--- a/roundup/cgi/PageTemplates/PageTemplate.py Tue Sep 24 07:39:52 2002 +0000 +++ b/roundup/cgi/PageTemplates/PageTemplate.py Wed Sep 25 02:10:25 2002 +0000 @@ -21,7 +21,7 @@ """ -__version__='$Revision: 1.2 $'[11:-2] +__version__='$Revision: 1.3 $'[11:-2] import sys @@ -32,7 +32,6 @@ from Expressions import getEngine from string import join, strip, rstrip, split, replace, lower, find from cStringIO import StringIO -from ComputedAttribute import ComputedAttribute class PageTemplate: "Page Templates using TAL, TALES, and METAL" @@ -48,10 +47,6 @@ _text = '' _error_start = '<!-- Page Template Diagnostics' - def macros(self): - return self.pt_macros() - macros = ComputedAttribute(macros, 1) - def pt_edit(self, text, content_type): if content_type: self.content_type = str(content_type) @@ -120,11 +115,16 @@ def pt_macros(self): if not self._v_cooked: self._cook() + __traceback_supplement__ = (PageTemplateTracebackSupplement, self) if self._v_errors: - __traceback_supplement__ = (PageTemplateTracebackSupplement, self) raise PTRuntimeError, 'Page Template %s has errors.' % self.id return self._v_macros + def __getattr__(self, name): + if name == 'macros': + return self.pt_macros() + raise AttributeError, name + def pt_source_file(self): return None # Unknown.
