Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre/post save hook registration #695

Closed
davidbrochart opened this issue Feb 8, 2022 · 0 comments · Fixed by #696
Closed

pre/post save hook registration #695

davidbrochart opened this issue Feb 8, 2022 · 0 comments · Fixed by #696

Comments

@davidbrochart
Copy link
Contributor

davidbrochart commented Feb 8, 2022

Problem

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.

Additional context

See jupyterlab/jupyterlab#11599 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant