Skip to content

Commit ab86642

Browse files
committed
fix #27
1 parent 91b79ab commit ab86642

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change log
22
================================================================================
33

4+
0.2.2 - 01.06.2016
5+
--------------------------------------------------------------------------------
6+
7+
#. quick bug fix, see `issue #27 <https://github.com/pyexcel/pyexcel-text/issues/27>`_
8+
9+
410
0.2.1 - 01.06.2016
511
--------------------------------------------------------------------------------
612

pyexcel_text.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
overrides: "pyexcel.yaml"
22
name: "pyexcel-text"
33
nick_name: text
4-
version: 0.2.1
4+
version: 0.2.2
55
file_type: text
66
dependencies:
77
- pyexcel>=0.2.2

pyexcel_text/_json.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: New BSD
99
"""
1010
import json
11+
import types
1112
from pyexcel.sources.rendererfactory import Renderer
1213

1314
file_types = ('json',)
@@ -28,7 +29,9 @@ def render_book(self, book):
2829
def jsonify(sheet, file_type, write_title):
2930
content = ""
3031
table = sheet.to_array()
31-
if hasattr(sheet, 'colnames'):
32+
if isinstance(table, types.GeneratorType):
33+
table = list(table)
34+
else:
3235
colnames = sheet.colnames
3336
rownames = sheet.rownames
3437
# In the following, row[0] is the name of each row
@@ -39,8 +42,6 @@ def jsonify(sheet, file_type, write_title):
3942
table = [dict(zip(colnames, row)) for row in table[1:]]
4043
elif rownames:
4144
table = dict((row[0], row[1:]) for row in table)
42-
else:
43-
table = list(table)
4445
if write_title:
4546
content = {sheet.name: table}
4647
else:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
NAME = 'pyexcel-text'
99
AUTHOR = 'C.W.'
10-
VERSION = '0.2.1'
10+
VERSION = '0.2.2'
1111
EMAIL = 'wangc_2011 (at) hotmail.com'
1212
LICENSE = 'New BSD'
1313
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])

0 commit comments

Comments
 (0)