I think this is good practice in general, but is a required change for https://github.com/nion-software/nionswift/pull/1082, because that does not guarantee an order for the console startup code lines anymore.
So if the startup code registered here gets executed before the default one from ConsoleDialog.py, the code here will fail because of the missing Registry import.
This change makes the startup code registered here independent from other code that migh or might not run first.
I think this is good practice in general, but is a required change for https://github.com/nion-software/nionswift/pull/1082, because that does not guarantee an order for the console startup code lines anymore. So if the startup code registered here gets executed before the default one from
ConsoleDialog.py
, the code here will fail because of the missingRegistry
import. This change makes the startup code registered here independent from other code that migh or might not run first.