diff output_templates.py @ 153:ebdd20cfba69

plots finally editable
author catherine@Elli.myhome.westell.com
date Mon, 29 Sep 2008 05:28:28 -0400
parents 3b1e25cc0e38
children
line wrap: on
line diff
--- a/output_templates.py	Fri Sep 26 16:31:17 2008 -0400
+++ b/output_templates.py	Mon Sep 29 05:28:28 2008 -0400
@@ -1,15 +1,20 @@
 import genshi.template
 
-xml_template = genshi.template.NewTextTemplate("""
+# To make more output formats available to sqlpython, just edit this
+# file, or place a copy in your local directory and edit that.
+
+output_templates = {
+
+'\\x': genshi.template.NewTextTemplate("""
 <xml>
   <${tblname}_resultset>{% for row in rows %}
     <$tblname>{% for (colname, itm) in zip(colnames, row) %}
       <${colname.lower()}>$itm</${colname.lower()}>{% end %}
     </$tblname>{% end %}
   </${tblname}_resultset>
-</xml>""")
-    
-html_template = genshi.template.MarkupTemplate("""
+</xml>"""),
+
+'\\h': genshi.template.MarkupTemplate("""
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns:py="http://genshi.edgewall.org/" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
@@ -32,16 +37,18 @@
       </tr>
     </table>
   </body>
-</html>""")
+</html>"""),
 
-list_template = genshi.template.NewTextTemplate("""
+'\\g': genshi.template.NewTextTemplate("""
 {% for (rowNum, row) in enumerate(rows) %}
 **** Row: ${rowNum + 1}
 {% for (colname, itm) in zip(colnames, row) %}$colname: $itm
-{% end %}{% end %}""")
+{% end %}{% end %}"""),
 
-aligned_list_template = genshi.template.NewTextTemplate("""
+'\\G': genshi.template.NewTextTemplate("""
 {% for (rowNum, row) in enumerate(rows) %}
 **** Row: ${rowNum + 1}
 {% for (colname, itm) in zip(colnames, row) %}${colname.ljust(colnamelen)}: $itm
-{% end %}{% end %}""")
+{% end %}{% end %}"""),
+
+}