本文整理汇总了Python中nbconvert.preprocessors.ExecutePreprocessor.enabled方法的典型用法代码示例。如果您正苦于以下问题:Python ExecutePreprocessor.enabled方法的具体用法?Python ExecutePreprocessor.enabled怎么用?Python ExecutePreprocessor.enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nbconvert.preprocessors.ExecutePreprocessor
的用法示例。
在下文中一共展示了ExecutePreprocessor.enabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Blueprint
# 需要导入模块: from nbconvert.preprocessors import ExecutePreprocessor [as 别名]
# 或者: from nbconvert.preprocessors.ExecutePreprocessor import enabled [as 别名]
import os
from flask import Blueprint
from mongoengine import DoesNotExist
from nbformat import v4 as nbf
from nbconvert.preprocessors import ExecutePreprocessor
from mpcontribs.api.core import SwaggerView
from mpcontribs.api.notebooks.document import Notebooks
notebooks = Blueprint("notebooks", __name__)
exprep = ExecutePreprocessor(timeout=600, allow_errors=False)
exprep.log.setLevel('DEBUG')
exprep.enabled = True
class NotebookView(SwaggerView):
def get(self, cid):
"""Retrieve (and build) notebook for a single contribution [internal].
---
operationId: get_entry
parameters:
- name: cid
in: path
type: string
pattern: '^[a-f0-9]{24}$'
required: true
description: contribution ID (ObjectId)
responses:
200:
description: single notebook
schema:
$ref: '#/definitions/NotebooksSchema'