summaryrefslogtreecommitdiff
path: root/tablib
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2010-10-04 15:50:41 -0400
committerKenneth Reitz <me@kennethreitz.com>2010-10-04 15:50:41 -0400
commit817eedd6f5cdc8dab03b024947bf0b2663ccc820 (patch)
tree2d05c584c1d6af7978de13db28f758dfed0225a6 /tablib
parent4d1c5a99966d8972bc0737389d6bf670c810dca3 (diff)
downloadtablib-817eedd6f5cdc8dab03b024947bf0b2663ccc820.tar.gz
Only wrap when needed.
Diffstat (limited to 'tablib')
-rw-r--r--tablib/formats/_xls.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tablib/formats/_xls.py b/tablib/formats/_xls.py
index 76e9318..0e989a7 100644
--- a/tablib/formats/_xls.py
+++ b/tablib/formats/_xls.py
@@ -9,9 +9,12 @@ import cStringIO
title = 'xls'
extentions = ('xls',)
+
+# special styles
wrap = xlwt.easyxf("alignment: wrap on")
bold = xlwt.easyxf("font: bold on")
+
def export_set(dataset):
"""Returns XLS representation of Dataset."""
@@ -62,6 +65,9 @@ def dset_sheet(dataset, ws):
# wrap the rest
else:
- ws.write(i, j, col, wrap)
+ if '\n' in col:
+ ws.write(i, j, col, wrap)
+ else:
+ ws.write(i, j, col)
\ No newline at end of file