diff --git a/toml_handling.py b/toml_handling.py index c6b408e872ce3b7796bae8ed50365d3be78ee1ee..7d1f22464369f1bf4dbb195c3e0a98b43129c83c 100644 --- a/toml_handling.py +++ b/toml_handling.py @@ -76,21 +76,16 @@ def access_toml_file(cam_serial_swig_adress): # for parameter in data.items(): # print(f'Parameter_after_updating: {parameter}') + # change data to update befor uploading to the file + cam_data_update = data + # # Write to modified config: # + # move to the end with open(config_filename, "w") as f: toml.dump(data, f) - # - # open toml file to use updated camera input and SWIG: - # - with open(config_filename, "rb") as f: - cam_data_update = tomllib.load(f) - - for new_parameter in cam_data_update.items(): - print(f'Updated_Parameter: {new_parameter}') # for debug - return cam_data_update # access_toml_file(cam_serial_swig_adress) @@ -101,3 +96,5 @@ def access_toml_file(cam_serial_swig_adress): # test2 = list(cam_data_update.get('connected_cameras').keys())[0] # print(f'Camera_ID_Updated: {test2}') + +# split into two files one read and other write