内容管理器:Jupyterhub钩子文件管理器。
项目描述
支持钩子内容的Jupyterhub文件管理器内容管理器
安装
pip install jupyterhub_hook_filemanager
在您的jupyterhub配置文件中
from jupyterhub_hook_filemanager.hook_filemanager import HookFileContentsManager c.NotebookApp.contents_manager_class = HookFileContentsManager
c.HookFileContentsManager.pre_get_hook = your_function c.HookFileContentsManager.post_get_hook = your_function
your_function 应该期望一个具有属性 name(用户登录名)和 hook_name(调用的钩子)的 user_object。
因此,在您的函数中
your_function(path, content, type, format, contents_manager): send_info(contents_manager.user.name, path)
c.HookFileContentsManager.pre_update_hook = your_function c.HookFileContentsManager.post_update_hook = your_function
your_function 应该期望一个具有属性 name(用户登录名)和 hook_name(调用的钩子)的 user_object。
因此,在您的函数中
your_function(model, path, contents_manager): send_info(contents_manager.user.name, path, model)
c.HookFileContentsManager.pre_delete_hook = your_function c.HookFileContentsManager.post_delete_hook = your_function
your_function 应该期望一个具有属性 name(用户登录名)和 hook_name(调用的钩子)的 user_object。
因此,在您的函数中
your_function(path, contents_manager): send_info(contents_manager.user.name, path)
pre_save_hook 和 post_save_hook 在默认文档中指定: https://jupyter-notebook.pythonlang.cn/en/latest/extending/savehooks.html