electro-smith / DaisyExamples

Examples for the Daisy Platform
https://github.com/electro-smith/DaisyWiki/wiki
MIT License
372 stars 193 forks source link

helper.py Copy operation can introduce bugs #213

Open CorvusPrudens opened 3 years ago

CorvusPrudens commented 3 years ago

During the copy operation of helper.py, the source code can be opened and modified by the rewrite_replace function. This is not ideal of the project name is, say, QSPI, and a macro is called DSY_QSPI_BSS (the QSPI would be replaced by the new project name). There should probably just be a check that excludes files with .cpp or .h extensions.

Also, line 122 is mistakenly formatted as if it were a C printf.

stephenhensley commented 3 years ago

Good catch, should be easy to fix.

I'm down with a generic "don't open .h/.c/.s/.cpp" rule. The file name should still be replaced, but none of the contents need be changed. Can't think of a case where that'd be desirable anyway.