changeset 647:8147f25af5f7

to textshaper
author Jeff Hammel <k0scist@gmail.com>
date Thu, 13 Mar 2014 13:54:03 -0700
parents 0e15d5aa78a2
children c6d3bfb2a21c
files python/tablify.py
diffstat 1 files changed, 0 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/python/tablify.py	Tue Mar 11 23:00:50 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-def tablify(table_lines, header=True):
-    table = '<table>\n'
-    if header:
-        tag, invtag = '<th> ', ' </th>'
-    else:
-        tag, invtag = '<td> ', ' </td>'
-    if not hasattr(table_lines, '__iter__'):
-        table_lines = ( table_lines, )
-    for i in table_lines:
-        table += '<tr>'
-        if not hasattr(i, '__iter__'):
-            i = (i,)
-        for j in i:
-            table += tag + str(j) + invtag
-        table += '</tr>\n'
-        tag = '<td> '
-        invtag = ' </td>'
-    table += '</table>'
-    return table