https://github.com/Ant0nidas/CK3-Playset-Preserver/blob/dcbf80eaccdc7c617d9c22d3069aa7394a14b923/CK3_PP.py#L65-L66
locate_ck3_directory relies on __file__, which works in typical use cases, including the only documented ways to use the tool, but it's bad practice for a few reasons
at minimum, the program shouldn't crash if someone does import CK3_PP; CK3_PP.main() (which leaves __file__ unset). currently it crashes in this case.
ideally we have more separation of concerns and the directory can be injected somehow in scenarios like the above.
https://github.com/Ant0nidas/CK3-Playset-Preserver/blob/dcbf80eaccdc7c617d9c22d3069aa7394a14b923/CK3_PP.py#L65-L66
locate_ck3_directoryrelies on__file__, which works in typical use cases, including the only documented ways to use the tool, but it's bad practice for a few reasonsat minimum, the program shouldn't crash if someone does
import CK3_PP; CK3_PP.main()(which leaves__file__unset). currently it crashes in this case.ideally we have more separation of concerns and the directory can be injected somehow in scenarios like the above.