napari_plugin_engine/hooks.py
def _add_hookimpl(self, hookimpl: HookImplementation):
        """Add an implementation to the callback chain."""
        if hookimpl.hookwrapper:
            methods = self._wrappers
        else:
            methods = self._nonwrappers

        if hookimpl.trylast:
            methods.insert(0, hookimpl)
        elif hookimpl.tryfirst:
            methods.append(hookimpl)
        else:
            # find last non-tryfirst method
            i = len(methods) - 1
            while i >= 0 and methods[i].tryfirst:
                i -= 1
            methods.insert(i + 1, hookimpl)
Add an implementation to the callback chain.
Add an implementation to the callback chain.
Add an implementation to the callback chain .
def _add_hookimpl(self, hookimpl: HookImplementation):
        if hookimpl.hookwrapper:
            methods = self._wrappers
        else:
            methods = self._nonwrappers
        if hookimpl.trylast:
            methods.insert(0, hookimpl)
        elif hookimpl.tryfirst:
            methods.append(hookimpl)
        else:
            i = len(methods) - 1
            while i >= 0 and methods[i].tryfirst:
                i -= 1
            methods.insert(i + 1, hookimpl)
def _add_hookimpl ( self , hookimpl : HookImplementation ) : if hookimpl . hookwrapper : methods = self . _wrappers else : methods = self . _nonwrappers if hookimpl . trylast : methods . insert ( 0 , hookimpl ) elif hookimpl . tryfirst : methods . append ( hookimpl ) else : i = len ( methods ) - 1 while i >= 0 and methods [ i ] . tryfirst : i -= 1 methods . insert ( i + 1 , hookimpl )
Add an implementation to the callback chain.
Add an implementation to the callback chain .
"""Add an implementation to the callback chain.""" # find last non-tryfirst method
self
hookimpl
HookImplementation