@@ -45,31 +45,37 @@ This small section outlines the steps to adapt **pyexcel-webio** for your favour
4545 extension = filename.split(".")[1]
4646 return extension, filehandle
4747
48- def load_single_sheet(self, field_name=None, sheet_name=None, **keywords):
48+ def load_single_sheet(self, field_name=None, sheet_name=None,
49+ **keywords):
4950 file_type, file_handle = self._get_file_tuple(field_name)
50- return pe.load_from_memory(file_type, file_handle.read(), sheet_name, **keywords)
51+ return pe.get_sheet(file_type=file_type,
52+ content=file_handle.read(),
53+ sheet_name=sheet_name,
54+ **keywords)
5155
5256 def load_book(self, field_name=None, **keywords):
5357 file_type, file_handle = self._get_file_tuple(field_name)
54- return pe.load_book_from_memory(file_type, file_handle.read(), **keywords)
58+ return pe.get_book(file_type=file_type,
59+ content=file_handle.read(),
60+ **keywords)
5561
56622. Plugin in a response method that has the following signature::
5763
58- def your_func(content, content_type=None, status=200):
59- ....
64+ def your_func(content, content_type=None, status=200):
65+ ....
6066
61- or a response class has the same signature::
67+ or a response class has the same signature::
6268
63- class YourClass:
64- def __init__(self, content, content_type=None, status=200):
65- ....
69+ class YourClass:
70+ def __init__(self, content, content_type=None, status=200):
71+ ....
6672
67- For example, with **Flask **, it is just a few lines::
73+ For example, with **Flask**, it is just a few lines::
6874
69- from flask import Response
75+ from flask import Response
7076
7177
72- webio.ExcelResponse = Response
78+ webio.ExcelResponse = Response
7379
7480
75813. Then make the proxy for **make_response ** series by simply copying the following lines to your extension::
0 commit comments