From 817eedd6f5cdc8dab03b024947bf0b2663ccc820 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 4 Oct 2010 15:50:41 -0400 Subject: [PATCH 1/4] Only wrap when needed. --- tablib/formats/_xls.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 From 6feb59504a793bcf8b82b9e00e5e5a74e370f3e0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 4 Oct 2010 15:50:52 -0400 Subject: [PATCH 2/4] Version bump. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a297169..2dbdfb6 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ if sys.argv[-1] == "publish": setup( name='tablib', - version='0.8.3', + version='0.8.4', description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)', long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(), From 19ac9b97162a248d52b34ca3dad24618230897c1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 4 Oct 2010 15:51:05 -0400 Subject: [PATCH 3/4] Updated history for v0.8.4. --- HISTORY.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 350cb6f..b9a862d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,5 +1,10 @@ History ======= +0.8.4 (2010-10-04) +------------------ + +* Upated XLS output: Only wrap if '\n' in cell. + 0.8.3 (2010-10-04) ------------------ @@ -10,9 +15,11 @@ History 0.8.2 (2010-10-04) ------------------ + * Added alignment wrapping to written cells. * Added separator support to XLS. + 0.8.1 (2010-09-28) ------------------ * Packaging Fix From 5e433c263d2c7ca333503f45c54430bb2ff014da Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 4 Oct 2010 15:51:45 -0400 Subject: [PATCH 4/4] version bump v0.8.4 --- tablib/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tablib/core.py b/tablib/core.py index 69e7549..aa840ad 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -7,8 +7,8 @@ from tablib.formats import FORMATS as formats __title__ = 'tablib' -__version__ = '0.8.3' -__build__ = 0x000803 +__version__ = '0.8.4' +__build__ = 0x000804 __author__ = 'Kenneth Reitz' __license__ = 'MIT' __copyright__ = 'Copyright 2010 Kenneth Reitz'