__init__.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:websauna 作者: websauna 项目源码 文件源码
def configure_notebook(self):
        """Setup pyramid_notebook integration."""

        # Check if we have IPython installed
        try:
            pkg_resources.get_distribution('IPython[notebook]')
        except pkg_resources.DistributionNotFound:
            return

        try:
            import websauna.system.notebook.views
            import websauna.system.notebook.adminviews
            import websauna.system.notebook.subscribers
        except ImportError:
            # Have installed IPython[Notebook], but not pyramid_notebook
            return

        self.config.add_route('admin_shell', '/notebook/admin-shell')
        self.config.add_route('shutdown_notebook', '/notebook/shutdown')
        self.config.add_route('notebook_proxy', '/notebook/*remainder')
        self.config.scan(websauna.system.notebook.views)
        self.config.scan(websauna.system.notebook.adminviews)
        self.config.scan(websauna.system.notebook.subscribers)

        self.config.registry.features.add("notebook")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号