Skip to content

Commit 44b5526

Browse files
committed
fix #1: use latest api from pyexcel
1 parent 992a6cc commit 44b5526

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
# built documents.
5454
#
5555
# The short X.Y version.
56-
version = '0.0.3'
56+
version = '0.0.4'
5757
# The full version, including alpha/beta/rc tags.
58-
release = '0.0.3'
58+
release = '0.0.4'
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.

pyexcel_webio/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ def make_response_from_dict(adict,
297297
:param file_type: same as :meth:`~pyexcel_webio.make_response`
298298
:param status: same as :meth:`~pyexcel_webio.make_response`
299299
:returns: http response
300-
"""
301-
return make_response(pe.load_from_dict(adict),
300+
"""
301+
sheet = pe.get_sheet(adict=adict)
302+
return make_response(sheet,
302303
file_type, status, **keywords)
303304

304305

@@ -313,7 +314,8 @@ def make_response_from_records(records,
313314
:param status: same as :meth:`~pyexcel_webio.make_response`
314315
:returns: http response
315316
"""
316-
return make_response(pe.load_from_records(records),
317+
sheet = pe.get_sheet(records=records)
318+
return make_response(sheet,
317319
file_type, status, **keywords)
318320

319321

@@ -329,7 +331,8 @@ def make_response_from_book_dict(adict,
329331
:param status: same as :meth:`~pyexcel_webio.make_response`
330332
:returns: http response
331333
"""
332-
return make_response(pe.Book(adict), file_type, status, **keywords)
334+
book = pe.get_book(bookdict=adict)
335+
return make_response(book, file_type, status, **keywords)
333336

334337

335338
def make_response_from_query_sets(query_sets, column_names,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
setup(
1616
name='pyexcel-webio',
1717
author="C. W.",
18-
version='0.0.3',
18+
version='0.0.4',
1919
author_email="wangc_2011@hotmail.com",
2020
url="https://github.com/chfw/pyexcel-webio",
2121
description='A generic request and response interface for pyexcel web extensions.',

tests/test_webio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def test_make_response_from_book_dict(self):
318318
self.verify()
319319

320320
def verify(self):
321-
book = pe.load_book(OUTPUT)
321+
book = pe.get_book(file_name=OUTPUT)
322322
assert book.to_dict() == self.content
323323

324324
def tearDown(self):
@@ -341,7 +341,7 @@ def test_make_response_from_tables(self):
341341
session.add(row4)
342342
session.commit()
343343
webio.make_response_from_tables(session, [Signature, Signature2], "xls")
344-
book = pe.load_book(OUTPUT)
344+
book = pe.get_book(file_name=OUTPUT)
345345
expected = OrderedDict()
346346
expected.update({'signature': [['X', 'Y', 'Z'], [1, 2, 3], [4, 5, 6]]})
347347
expected.update({'signature2': [['A', 'B', 'C'], [1, 2, 3], [4, 5, 6]]})

0 commit comments

Comments
 (0)