File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1+ import xlrd
2+ import zipfile
3+
14from io import BytesIO
25from openpyxl import load_workbook
3- import xlrd , zipfile
46from collections import OrderedDict
5- from ..exceptions import TableTooBigError , MissingRequirementsError
67from ..utilities import (
7- header_population ,
88 to_bytes ,
99 parse_xls ,
1010 parse_xlsx
1111)
12- from mfr .extensions .tabular .compat import range , basestring
1312
1413
1514def xlsx_xlrd (fp ):
Original file line number Diff line number Diff line change 88from tempfile import NamedTemporaryFile
99
1010from mfr .extensions .tabular import compat
11- from mfr .core .exceptions import SubprocessError
11+ from mfr .core .exceptions import SubprocessError , TooBigToRenderError
1212from mfr .extensions .tabular .settings import (PSPP_CONVERT_BIN ,
1313 PSPP_CONVERT_TIMEOUT )
1414
@@ -159,13 +159,12 @@ def parse_xlsx(wb, sheets):
159159
160160def verify_size (rows , cols , ext ):
161161 if rows > MAX_SIZE or cols > MAX_SIZE :
162- raise TableTooBigError ('Table is too large to render.' , ext ,
162+ raise TooBigToRenderError ('Table is too large to render.' , ext ,
163163 nbr_cols = cols , nbr_rows = rows )
164164
165165
166166def fix_headers (raw ):
167- return [str (v ) if v not in (None , '' ) else f'Unnamed: { i + 1 } '
168- for i , v in enumerate (raw )]
167+ return [str (v ) if v not in (None , '' ) else f'Unnamed: { i + 1 } ' for i , v in enumerate (raw )]
169168
170169
171170def row_vals (row , datemode ):
You can’t perform that action at this time.
0 commit comments