mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
4d526da58f
Summary: Move all the plugins python code into the main folder with the core code. Register file importing functions in the same main.py entrypoint as the data engine. Remove options relating to different entrypoints and code directories. The only remaining plugin-specific option in NSandbox is the import directory/mount, i.e. where files to be parsed are placed. Test Plan: this Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D2965
19 lines
640 B
Python
19 lines
640 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):
|
|
from imports.import_xls import import_file
|
|
return import_file(file_source, parse_options)
|
|
|
|
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)
|