mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
27 lines
969 B
Python
27 lines
969 B
Python
from backend.condition.domain.mapping.lbwf.lbwf_mapper import LbwfMapper
|
|
from backend.condition.domain.mapping.mapper import Mapper
|
|
from backend.condition.domain.mapping.peabody.peabody_mapper import PeabodyMapper
|
|
from backend.condition.file_type import FileType
|
|
from backend.condition.parsing.parser import Parser
|
|
from backend.condition.parsing.lbwf_parser import LbwfParser
|
|
from backend.condition.parsing.peabody_parser import PeabodyParser
|
|
|
|
|
|
def select_parser(file_type: FileType) -> Parser:
|
|
if file_type is FileType.LBWF:
|
|
return LbwfParser()
|
|
|
|
if file_type is FileType.Peabody:
|
|
return PeabodyParser()
|
|
|
|
raise ValueError("Unrecognised file type, unable to instantiate Parser")
|
|
|
|
|
|
def select_mapper(file_type: FileType) -> Mapper:
|
|
if file_type is FileType.LBWF:
|
|
return LbwfMapper()
|
|
|
|
if file_type is FileType.Peabody:
|
|
return PeabodyMapper()
|
|
|
|
raise ValueError("Unrecognised file type, unable to instantiate Mapper")
|