Thanks for the pretty interesting discussion.
I personally tent to agree with Tyler that the responsibility of
deciding if the given add-on should be used in secure screens should be
on the user, but that is not always possible / practical.
While both the pattern #2 and #3 proposed by Cyrille are valid the
following changes makes them nicer IMO.
For pattern #2 you can easily avoid unnecessary indentation by keeping
the main class of your plugin in a separate file. To use my winWizard
add-on as an example the __init__.py may look like this:
### Start of example 2 modified:
GlobalPlugin = globalPluginHandler.GlobalPlugin
from . import winWizard
GlobalPlugin = winWizard.GlobalPlugin
## End of example 2 modified.
For example #3 which is pretty nice as long as your imports don't have
side effects you can easily use class decorator to make this more
## Start of example 3 modified:
# and then before definition of your plugin class:
## end of example 3 modified.