Skip to content
Snippets Groups Projects
Commit 5d2e86c0 authored by mhoeschle's avatar mhoeschle
Browse files

delete opening updated toml after updating.

parent 2fdc78aa
No related branches found
No related tags found
No related merge requests found
...@@ -76,21 +76,16 @@ def access_toml_file(cam_serial_swig_adress): ...@@ -76,21 +76,16 @@ def access_toml_file(cam_serial_swig_adress):
# for parameter in data.items(): # for parameter in data.items():
# print(f'Parameter_after_updating: {parameter}') # print(f'Parameter_after_updating: {parameter}')
# change data to update befor uploading to the file
cam_data_update = data
# #
# Write to modified config: # Write to modified config:
# #
# move to the end
with open(config_filename, "w") as f: with open(config_filename, "w") as f:
toml.dump(data, 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 return cam_data_update
# access_toml_file(cam_serial_swig_adress) # access_toml_file(cam_serial_swig_adress)
...@@ -101,3 +96,5 @@ def 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] # test2 = list(cam_data_update.get('connected_cameras').keys())[0]
# print(f'Camera_ID_Updated: {test2}') # print(f'Camera_ID_Updated: {test2}')
# split into two files one read and other write
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment