fix #2: ValueError: More than 4094 XFs (styles) # when writing to xls : reference: http://stackoverflow.com/questions/17130516/xlwt-set-style-making-error-more-than-4094-xfs-styles
This commit is contained in:
parent
09a698b863
commit
18876f9d37
|
@ -201,7 +201,7 @@ class XLWriter(BookWriter):
|
|||
def __init__(self, file, **keywords):
|
||||
"""Initialize a xlwt work book"""
|
||||
BookWriter.__init__(self, file, **keywords)
|
||||
self.wb = Workbook()
|
||||
self.wb = Workbook(style_compression=2)
|
||||
|
||||
def create_sheet(self, name):
|
||||
"""Create a xlwt writer"""
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
import os
|
||||
import pyexcel as pe
|
||||
import pyexcel.ext.xls
|
||||
import pyexcel.ext.xls as xls
|
||||
from pyexcel_io import OrderedDict
|
||||
import datetime
|
||||
|
||||
|
||||
|
@ -20,4 +21,11 @@ class TestBugFix:
|
|||
"test-fixtures",
|
||||
"test-date-format.xls"))
|
||||
assert s[0,0] == datetime.datetime(2015, 11, 11, 11, 12, 0)
|
||||
|
||||
|
||||
def test_pyexcel_xls_issue_2(self):
|
||||
data = OrderedDict()
|
||||
array = []
|
||||
for i in xrange(4100):
|
||||
array.append([datetime.datetime.now()])
|
||||
data.update({"test": array})
|
||||
s = xls.save_data("test.xls", data)
|
Loading…
Reference in New Issue