def parse_csv(self,rows):
"""Parse the list of source table rows. Each row item in the returned
list contains a list of cell data elements."""
import StringIO
import csv
result = []
rdr = csv.reader(StringIO.StringIO('\r\n'.join(rows)),
skipinitialspace=True)
try:
for row in rdr:
result.append(row)
except Exception:
raise EAsciiDoc,'csv parse error: %s' % row
return result
评论列表
文章目录