Hi all,
following my problems with my template code and some obscure hide of
the my bugged code by Templator, I modify template.py and add some
code for showing up the .html code plus the Templator code.

I don't know if it's so clear or ready to include into template.py,
but... it do for me what I need!

Michele

@@ -687,7 +687,15 @@
         self.sections = sections

     def emit(self, indent, text_indent=''):
+        l = []
+        for s in self.sections:
+            try:
+                l.append(s.emit(indent, text_indent) )
+            except TypeError:
+                pass
+        return "\n" + "".join(l)



     def __repr__(self):
         return repr(self.sections)
@@ -910,11 +918,17 @@
             compiled_code = compile(code, filename, 'exec')
         except SyntaxError, e:
             # display template line that caused the error along with
the traceback.
+
+            l = []
+            for idx, line in enumerate(code.split("\n")):
+                l.append("%s-%s" % (idx+1, line))
+            print "\n\nTemplate file error: %s\n%s" %
(repr(filename), "\n".join(l))

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to