Commits

Rick Copeland  committed 6af3b97

Annotate line number information

  • Participants
  • Parent commits 4adf4a3

Comments (0)

Files changed (2)

File kajiki/template.py

     return type(ns.__name__,(_Template,), dct)
 
 def from_ir(ir_node):
-    py_text = '\n'.join(map(str, ir_node.py()))
+    py_lines = list(ir_node.py())
+    py_text = '\n'.join(map(str, py_lines))
+    py_linenos = [
+        (i+1, l._lineno)
+        for i,l in enumerate(py_lines)
+        if l._lineno ]
+    print py_linenos
     dct = dict(kajiki=kajiki)
     try:
         exec py_text in dct

File kajiki/tests/test_xml.py

 Sincerely,<br/><em>Rick</em>
 </div>''', rsp
         child = loader.import_('child.html')
-        print child.py_text
         rsp = child({'to':'Mark', 'from_':'Rick'}).__kj__.render()
         assert rsp=='''<div>Dear Mark: