[Checkins] SVN: z3c.pt/trunk/ Moved classes.
Malthe Borch
mborch at gmail.com
Sat Sep 13 15:30:03 EDT 2008
Log message for revision 91125:
Moved classes.
Changed:
U z3c.pt/trunk/CHANGES.txt
D z3c.pt/trunk/src/z3c/pt/macro.py
U z3c.pt/trunk/src/z3c/pt/template.py
U z3c.pt/trunk/src/z3c/pt/testing.py
-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt 2008-09-13 19:27:26 UTC (rev 91124)
+++ z3c.pt/trunk/CHANGES.txt 2008-09-13 19:30:03 UTC (rev 91125)
@@ -6,6 +6,9 @@
Backwards incompatibilities
+- Moved contents of ``z3c.pt.macro`` module into
+ ``z3c.pt.template``. [malthe]
+
- Namespace attribute "xmlns" no longer rendered for templates with no
explicit document type. [malthe]
Deleted: z3c.pt/trunk/src/z3c/pt/macro.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/macro.py 2008-09-13 19:27:26 UTC (rev 91124)
+++ z3c.pt/trunk/src/z3c/pt/macro.py 2008-09-13 19:30:03 UTC (rev 91125)
@@ -1,12 +0,0 @@
-class Macro(object):
- def __init__(self, render):
- self.render = render
-
-class Macros(object):
- def __init__(self, render_macro):
- self.render = render_macro
-
- def __getitem__(self, name):
- def render(**kwargs):
- return self.render(name, parameters=kwargs)
- return Macro(render)
Modified: z3c.pt/trunk/src/z3c/pt/template.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/template.py 2008-09-13 19:27:26 UTC (rev 91124)
+++ z3c.pt/trunk/src/z3c/pt/template.py 2008-09-13 19:30:03 UTC (rev 91125)
@@ -1,5 +1,4 @@
import os
-import macro
import config
import doctypes
import filecache
@@ -36,7 +35,7 @@
@property
def macros(self):
- return macro.Macros(self.render_macro)
+ return Macros(self.render_macro)
@property
def compiler(self):
@@ -182,3 +181,15 @@
return template
return self.factory(filename, format=format)
+class Macro(object):
+ def __init__(self, render):
+ self.render = render
+
+class Macros(object):
+ def __init__(self, render_macro):
+ self.render = render_macro
+
+ def __getitem__(self, name):
+ def render(**kwargs):
+ return self.render(name, parameters=kwargs)
+ return Macro(render)
Modified: z3c.pt/trunk/src/z3c/pt/testing.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/testing.py 2008-09-13 19:27:26 UTC (rev 91124)
+++ z3c.pt/trunk/src/z3c/pt/testing.py 2008-09-13 19:30:03 UTC (rev 91125)
@@ -1,8 +1,8 @@
import translation
+import template
import generation
import expressions
import doctypes
-import macro
import etree
import config
import utils
@@ -72,7 +72,7 @@
compiler = TestCompiler(self.body, self.parser)
template = compiler(macro=name, parameters=parameters)
return template.render(**parameters)
- return macro.Macros(render)
+ return template.Macros(render)
class MockElement(translation.Element, translation.VariableInterpolation):
translator = expressions.python_translation
More information about the Checkins
mailing list