init
This commit is contained in:
15
python/mrds_common/mrds/processors/__init__.py
Normal file
15
python/mrds_common/mrds/processors/__init__.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user