Feature Flags for custom Python slicer extensions

Hello everyone,

I want to develop a feature flag (possibly in a config file) such that it helps to enable/disable several functionalities of the extension(shows/hides a tab completely from the user). Can anyone please help me with possible ideas to implement this or best approaches to handle this problem.

Would the launcher.ini file be a good starting point? Is there a way I can add a key, or there is something even simplier already existing.

Thanks and Best regards,

You can store application settings persistently in the Slicer.ini file via the slicer.app.userSettings() object. See QSettings documentation for API description and Slicer scripted modules for usage examples.

1 Like

Thanks a lot, could set the flags via the .ini files and the slicer.app documentation helped along with configparser — Configuration file parser — Python 3.10.4 documentation