SNN2.src.io.IOHandler module
IO Module
Use this module to control io objects from the configuration file
- class SNN2.src.io.IOHandler.IOHandler(object: List[dict])
Bases:
objectIOHandler. Class used to handle and control io objects like file and folders
- check(key: str) bool
- define_object(obj: dict) dh | fh
define_object. Function used to define a single object and associate it to the DirectoryHandler or the FileHandler
- Parameters:
obj (dict) – Single object that must be handled
- evaluate_obj(obj: str) Tuple[str, str]
- evaluate_objs(objs: List[str]) List[Tuple[str, str]]
- evaluate_path(pth: str) str
evaluate_path. Evaluate a path if it contains other objects in it
- Parameters:
pth (str) – pth
- Return type:
str
- classmethod from_cfg(conf: ConfHandler) IOHandler
- get(elem: T) str
get. Returns the path of an object
- Parameters:
elem (str) – elem
- Return type:
str
- get_handler(elem: str) FileHandler | DirectoryHandler
get. Returns the handler of an object
- Parameters:
elem (str) – elem
- Return type:
str