You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way pre_save_hook and post_save_hook work is by direct attribute assignment in a FileContentsManager instance, e.g. file_contents_manager.pre_save_hook = my_hook (see the documentation). This doesn't play well when multiple hooks have to be registered e.g. by different server extensions.
Proposed Solution
I was thinking about implementing a setter, that would append hooks to a list under the hood, and then call them in sequence. But they are currently implemented as a traitlet. If we register hooks, that also raises the question of how to unregister them.
Problem
The way
pre_save_hook
andpost_save_hook
work is by direct attribute assignment in aFileContentsManager
instance, e.g.file_contents_manager.pre_save_hook = my_hook
(see the documentation). This doesn't play well when multiple hooks have to be registered e.g. by different server extensions.Proposed Solution
I was thinking about implementing a setter, that would append hooks to a list under the hood, and then call them in sequence. But they are currently implemented as a traitlet. If we register hooks, that also raises the question of how to unregister them.
Additional context
See jupyterlab/jupyterlab#11599 (comment).
The text was updated successfully, but these errors were encountered: