Mercurial > hg > TextShaper
comparison textshaper/tablify.py @ 37:8cf9a26b9aaa
STUB: textshaper/main.py textshaper/tablify.py
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Mon, 12 May 2014 10:29:06 -0700 |
| parents | 5ffa0dbcb7fe |
| children |
comparison
equal
deleted
inserted
replaced
| 36:55e0579e2143 | 37:8cf9a26b9aaa |
|---|---|
| 1 """ | |
| 2 functions having to do with tables | |
| 3 """ | |
| 4 | |
| 5 import csv | |
| 6 from .decorator import lines | |
| 7 from StringIO import StringIO | |
| 8 | |
| 9 @lines | |
| 10 def make_csv(text): | |
| 11 """make space-separated text into comma-separated""" | |
| 12 return [','.join(line.strip().split()) for line in text] | |
| 13 | |
| 1 def format_cols(rows, header=None, right_align=()): | 14 def format_cols(rows, header=None, right_align=()): |
| 2 if header: | 15 if header: |
| 3 raise NotImplementedError('TODO') # -> record TODO items | 16 raise NotImplementedError('TODO') # -> record TODO items |
| 4 if not rows: | 17 if not rows: |
| 5 return # XXX header | 18 return # XXX header |
