Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BaslerPypylonTools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Höschle
BaslerPypylonTools
Commits
5d2e86c0
Commit
5d2e86c0
authored
1 year ago
by
mhoeschle
Browse files
Options
Downloads
Patches
Plain Diff
delete opening updated toml after updating.
parent
2fdc78aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
toml_handling.py
+6
-9
6 additions, 9 deletions
toml_handling.py
with
6 additions
and
9 deletions
toml_handling.py
+
6
−
9
View file @
5d2e86c0
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment