file_handler module
- class file_handler.FileHandler[source]
Bases:
object
Class container for static methods responsible for file load and validate operations.
- static get_sequence_code(filename, sequence_search)[source]
Extract the sequence code from the filename.
- Parameters:
filename (str) – File name.
sequence_search (str) – Which sequence to look for. Default is “auto”.
- Returns:
Sequence if available. Else None.
- Return type:
str|None
- static load_project_file(file_path)[source]
Loads the project rvp file.
- Parameters:
file_path (str) – File path to the rvp project file.
- Returns:
Returns the Dictionary from the project file on loading the rvp File.Else False.
- Return type:
dict|bool
- static save_project_file(project_data: dict, output_path: str)[source]
Saves the project dictionary as a .rvp (pickle) file.
- Parameters:
project_data (dict) – Dictionary containing the project data.
output_path (str) – Output path to save the project file.
- Returns:
True if saved successfully, else False.
- static validate_image(image: str)[source]
Checks if the image files are supported.
- Parameters:
image (str) – Path to the image file.
- Returns:
True on file validation. Else False.
- Return type:
bool