ussserrr / stm32pio

Automate managing of STM32CubeMX + PlatformIO projects
https://pypi.org/project/stm32pio
Other
230 stars 24 forks source link

Remake patch() method to use configparser #3

Closed ussserrr closed 4 years ago

ussserrr commented 4 years ago

Instead of clumsily write a string with a patch to the platformio.ini we can use a configparser module to modify the .ini file. Note that it most likely erase all ; comments so we need to think about some workaround for this, maybe use difflib standard module to find all deltas.

ussserrr commented 4 years ago

There is no easy way to preserve comments while handling the platformio.ini via configparser though it is a robust approach to be sure that all parameters will be written and will not be doubled. So let's sacrifice comments.