Files
mars-elt/python/mrds_common/mrds/processors/__init__.py
Grzegorz Michalski 2c225d68ac init
2026-03-02 09:47:35 +01:00

16 lines
504 B
Python

from .xml_processor import XMLTaskProcessor
from .csv_processor import CSVTaskProcessor
def get_file_processor(global_config):
"""
Factory function to get the appropriate file processor class based on the file type in the global configuration.
"""
file_type = global_config.file_type.lower()
if file_type == "xml":
return XMLTaskProcessor
elif file_type == "csv":
return CSVTaskProcessor
else:
raise ValueError(f"Unsupported file type: {file_type}")