- Posts: 1108
- Thank you received: 599
Mesa Configuration Tool
4 years 1 month ago #252503
by JT
I removed all the items that the tool uses and placed them in a hidden file .mesact.conf. This is about 1/2 done now. This will unclutter the configname.ini file.
Next I'll read in the configname.ini file and use the configparser to only update the values from my tool instead of just writing a new file like currently I'm doing now.
The configname.hal, io.hal and ss.hal files will still be created each time and as before the custom.hal, shutdown.hal and postgui.hal files will not be touched once they are created.
This is a huge change in how I deal with the files so I thought it best to create a branch to work out the details and not break the master branch while working on the change.
JT
Replied by JT on topic Mesa Configuration Tool
Based on your suggestion I've created an ini branch where I'm completely changing how I deal with the ini file.
Code:Furthermore it would be good if unknown key value pairs (like "BACKLASH = 0.01") are not removed when generating the config. Maybe you can add a special section for that? Or remember the lines which didn't correspond to a supported value and print them when generating? This would also allow to keep comments.
I removed all the items that the tool uses and placed them in a hidden file .mesact.conf. This is about 1/2 done now. This will unclutter the configname.ini file.
Next I'll read in the configname.ini file and use the configparser to only update the values from my tool instead of just writing a new file like currently I'm doing now.
The configname.hal, io.hal and ss.hal files will still be created each time and as before the custom.hal, shutdown.hal and postgui.hal files will not be touched once they are created.
This is a huge change in how I deal with the files so I thought it best to create a branch to work out the details and not break the master branch while working on the change.
JT
Please Log in or Create an account to join the conversation.
4 years 1 month ago #252523
by HansU
Replied by HansU on topic Mesa Configuration Tool
This sounds nice 
Is the .mesact.conf file needed to edit the config with mesact or is it created when loading an INI file?
Is the .mesact.conf file needed to edit the config with mesact or is it created when loading an INI file?
Please Log in or Create an account to join the conversation.
4 years 1 month ago #252539
by JT
Replied by JT on topic Mesa Configuration Tool
Geez right in the middle of replying and the power went out... had to fire up the generator.
The .mesact.conf file is created when you build the configuration and is used to setup the tool when you load the ini. Not sure exactly how I will merge old and new configurations yet but that must be addressed.
I have tested my code and it doesn't change anything in the existing ini file that is added by a user so that is good.
JT
The .mesact.conf file is created when you build the configuration and is used to setup the tool when you load the ini. Not sure exactly how I will merge old and new configurations yet but that must be addressed.
I have tested my code and it doesn't change anything in the existing ini file that is added by a user so that is good.
JT
Please Log in or Create an account to join the conversation.
4 years 1 month ago #252572
by JT
Replied by JT on topic Mesa Configuration Tool
I have run into an issue with the python3 configparser, it does not allow duplicate keys and the [HAL] section can have duplicate keys for HALFILE. So I'll have to figure out how to get around that...
JT
JT
Please Log in or Create an account to join the conversation.
4 years 1 month ago #252577
by HansU
Replied by HansU on topic Mesa Configuration Tool
Hmm but I saw it as a big advantage that your tool can open a config without need for additional files.The .mesact.conf file is created when you build the configuration and is used to setup the tool when you load the ini. Not sure exactly how I will merge old and new configurations yet but that must be addressed.
Please Log in or Create an account to join the conversation.
4 years 1 month ago #252591
by JT
JT
Replied by JT on topic Mesa Configuration Tool
That is an advantage that you can share one file to create the whole configuration... I have solved the puzzle for the [HAL] duplicate keys issue. The disadvantage is the ini file gets very long... gotta ponder which way to go now.
The .mesact.conf file is created when you build the configuration and is used to setup the tool when you load the ini. Not sure exactly how I will merge old and new configurations yet but that must be addressed.
Hmm but I saw it as a big advantage that your tool can open a config without need for additional files.
JT
Please Log in or Create an account to join the conversation.
Time to create page: 0.070 seconds