Implemented reader file compatibility check.

This commit is contained in:
2024-05-27 18:22:16 +02:00
parent 2911416431
commit 3270ce5ed7

View File

@ -116,6 +116,10 @@ def read_txt_files_as_dict(filename : str ):
config_dict = yaml.load(stream, Loader=yaml.FullLoader)
except yaml.YAMLError as exc:
print(exc)
# Verify if file can be read by available intrument configurations.
if not any(key in filename for key in config_dict.keys()):
return {}
#TODO: this may be prone to error if assumed folder structure is non compliant
file_encoding = config_dict['default']['file_encoding'] #'utf-8'