Implemented reader file compatibility check.
This commit is contained in:
@ -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'
|
||||
|
Reference in New Issue
Block a user