mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 15:00:19 +00:00
Added wrapping support.
This commit is contained in:
@@ -9,7 +9,7 @@ import cStringIO
|
||||
|
||||
title = 'xls'
|
||||
extentions = ('xls',)
|
||||
|
||||
wrap = xlwt.easyxf("alignment: wrap on")
|
||||
|
||||
def export_set(dataset):
|
||||
"""Returns XLS representation of Dataset."""
|
||||
@@ -19,7 +19,7 @@ def export_set(dataset):
|
||||
|
||||
for i, row in enumerate(dataset._package(dicts=False)):
|
||||
for j, col in enumerate(row):
|
||||
ws.write(i, j, col)
|
||||
ws.write(i, j, col, wrap)
|
||||
|
||||
stream = cStringIO.StringIO()
|
||||
wb.save(stream)
|
||||
@@ -37,7 +37,7 @@ def export_book(databook):
|
||||
#for row in self._package(dicts=False):
|
||||
for i, row in enumerate(dset._package(dicts=False)):
|
||||
for j, col in enumerate(row):
|
||||
ws.write(i, j, col)
|
||||
ws.write(i, j, col, wrap)
|
||||
|
||||
|
||||
stream = cStringIO.StringIO()
|
||||
|
||||
Reference in New Issue
Block a user