mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
6c90de4d62
Summary: Use openpyxl instead of messytables (which used xlrd internally) in import_xls.py. Skip empty rows since excel files can easily contain huge numbers of them. Drop support for xls files (which openpyxl doesn't support) in favour of the newer xlsx format. Fix some details relating to python virtualenvs and dependencies, as Jenkins was failing to find new Python dependencies. Test Plan: Mostly relying on existing tests. Updated various tests which referred to xls files instead of xlsx. Added a Python test for skipping empty rows. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3406
20 lines
663 B
Python
20 lines
663 B
Python
def register_import_parsers(sandbox):
|
|
def parse_csv(file_source, options):
|
|
from imports.import_csv import parse_file_source
|
|
return parse_file_source(file_source, options)
|
|
|
|
sandbox.register("csv_parser.parseFile", parse_csv)
|
|
|
|
def parse_excel(file_source, parse_options):
|
|
# pylint: disable=unused-argument
|
|
from imports.import_xls import import_file
|
|
return import_file(file_source)
|
|
|
|
sandbox.register("xls_parser.parseFile", parse_excel)
|
|
|
|
def parse_json(file_source, parse_options):
|
|
from imports.import_json import parse_file
|
|
return parse_file(file_source, parse_options)
|
|
|
|
sandbox.register("json_parser.parseFile", parse_json)
|