Commits

Rick Copeland committed 0b58e32

Added XML closures

  • Participants
  • Parent commits a68f551

Comments (0)

Files changed (3)

-* XML closures
 * XML PIs
 * XML Comment tests
 * XML attribute support (non-py:-namespaced)

File fastpt/tests/v2/test_xml.py

     >${inner(x*2)}</py:def
 >${add(5)}</div>''')
         rsp = tpl(dict(name='Rick')).__fpt__.render()
-        print rsp
-        assert rsp == '15\n', rsp
+        assert rsp == '<div>15</div>', rsp
 
 if __name__ == '__main__':
     main()

File fastpt/v2/xml_template.py

 
     def _compile_def(self, node):
         old_in_def, self.in_def = self.in_def, True
-        body = self._compile_nop(node)
+        body = list(self._compile_nop(node))
         self.in_def = old_in_def
         if self.in_def:
             yield ir.InnerDefNode(node.getAttribute('function'), *body)