"""Toolbar provider registration. Routes through the ``kcsdk`` C++ module. The kcsdk module is required. """ def register_toolbar(provider): """Register a toolbar provider for automatic context injection. Delegates to ``kcsdk.register_toolbar()`` which stores the provider and auto-injects commands into the target editing contexts. """ try: import kcsdk except ImportError: raise RuntimeError( "kcsdk module not available. " "The kindred_sdk requires the kcsdk C++ module (libKCSDK)." ) kcsdk.register_toolbar(provider)