mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 15:00:19 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c66697280 | |||
| 13334b7996 | |||
| 77a5c8d3fb | |||
| 79d66cd250 | |||
| 77469ef655 | |||
| e21676d3bd | |||
| 7c59e1ae86 | |||
| 2814fbc381 | |||
| 9ca1d4ec54 | |||
| abbb4e32d8 | |||
| 9ba0451843 |
@@ -1,6 +1,11 @@
|
||||
History
|
||||
-------
|
||||
|
||||
0.11.3 (2016-02-16)
|
||||
+++++++++++++++++++
|
||||
|
||||
- Release fix.
|
||||
|
||||
0.11.2 (2016-02-16)
|
||||
+++++++++++++++++++
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Tablib'
|
||||
copyright = u'2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project'
|
||||
copyright = u'2016. A <a href="http://kennethreitz.org/">Kenneth Reitz</a> Project'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
||||
@@ -155,7 +155,7 @@ Once installed, we can generate our xUnit report with a single command. ::
|
||||
|
||||
This will generate a **nosetests.xml** file, which can then be analyzed.
|
||||
|
||||
.. _Nose: http://somethingaboutorange.com/mrl/projects/nose/
|
||||
.. _Nose: https://github.com/nose-devs/nose
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -18,8 +18,8 @@ from tablib.compat import OrderedDict, unicode
|
||||
|
||||
|
||||
__title__ = 'tablib'
|
||||
__version__ = '0.11.2'
|
||||
__build__ = 0x001102
|
||||
__version__ = '0.11.3'
|
||||
__build__ = 0x001103
|
||||
__author__ = 'Kenneth Reitz'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright 2016 Kenneth Reitz'
|
||||
@@ -1105,7 +1105,7 @@ class Databook(object):
|
||||
"""The number of the :class:`Dataset` objects within :class:`Databook`."""
|
||||
return len(self._datasets)
|
||||
|
||||
def load(self, format, in_stream, **kwargs):
|
||||
def load(self, in_stream, format, **kwargs):
|
||||
"""
|
||||
Import `in_stream` to the :class:`Databook` object using the `format`.
|
||||
|
||||
|
||||
+11
-13
@@ -17,6 +17,7 @@ import tablib
|
||||
Workbook = openpyxl.workbook.Workbook
|
||||
ExcelWriter = openpyxl.writer.excel.ExcelWriter
|
||||
get_column_letter = openpyxl.cell.get_column_letter
|
||||
DataTypeException = openpyxl.shared.exc.DataTypeException
|
||||
|
||||
from tablib.compat import unicode
|
||||
|
||||
@@ -120,33 +121,30 @@ def dset_sheet(dataset, ws, freeze_panes=True):
|
||||
if (row_number == 1) and dataset.headers:
|
||||
# ws.cell('%s%s'%(col_idx, row_number)).value = unicode(
|
||||
# '%s' % col, errors='ignore')
|
||||
ws.cell('%s%s'%(col_idx, row_number)).value = unicode(col)
|
||||
style = ws.get_style('%s%s' % (col_idx, row_number))
|
||||
style.font.bold = True
|
||||
if freeze_panes:
|
||||
# As already done in #53, but after Merge lost:
|
||||
# Export Freeze only after first Line
|
||||
ws.freeze_panes = 'A2'
|
||||
|
||||
|
||||
# bold separators
|
||||
elif len(row) < dataset.width:
|
||||
ws.cell('%s%s'%(col_idx, row_number)).value = unicode(
|
||||
'%s' % col, errors='ignore')
|
||||
style = ws.get_style('%s%s' % (col_idx, row_number))
|
||||
style.font.bold = True
|
||||
|
||||
# wrap the rest
|
||||
else:
|
||||
try:
|
||||
if '\n' in col:
|
||||
ws.cell('%s%s'%(col_idx, row_number)).value = unicode(
|
||||
'%s' % col, errors='ignore')
|
||||
str_col_value = unicode(col)
|
||||
except TypeError:
|
||||
str_col_value = ''
|
||||
|
||||
if '\n' in str_col_value:
|
||||
style = ws.get_style('%s%s' % (col_idx, row_number))
|
||||
style.alignment.wrap_text
|
||||
else:
|
||||
ws.cell('%s%s'%(col_idx, row_number)).value = unicode(
|
||||
'%s' % col, errors='ignore')
|
||||
except TypeError:
|
||||
ws.cell('%s%s'%(col_idx, row_number)).value = unicode(col)
|
||||
|
||||
|
||||
try:
|
||||
ws.cell('%s%s' % (col_idx, row_number)).value = col
|
||||
except (ValueError, TypeError, DataTypeException):
|
||||
ws.cell('%s%s' % (col_idx, row_number)).value = unicode(col)
|
||||
|
||||
Reference in New Issue
Block a user