Startup and Shutdown functions

On Startup

on_startup(self, ext_id)

Called when your Extension is loaded and passed its Extension ID. This is typically where your extension will create its UI and any other startup tasks that are needed.

# ext_id is current extension id. It can be used with extension manager to query additional information, like where
# this extension is located on filesystem.
def on_startup(self, ext_id):
    print("[ui.demo.ext] ui demo ext startup")

    self.create_ui()
    self.create_event_subscriptions()

On Shutdown

on_shutdown(self)

Called when your Extension is being unloaded. This is where you do any clean up tasks like closing open files, unsubscribing from events, etc…

def on_shutdown(self):
    print("[ui.demo.ext] ui demo ext shutdown")

    self.unsubscribe_from_events()