提供一个Bokeh应用程序处理程序,通过编译和执行Python源代码来构建文档。
Bokeh服务器命令行工具使用此处理程序生成运行脚本和笔记本的应用程序。
def make_doc(doc): # do work to modify the document, add plots, widgets, etc. return doc app = Application(FunctionHandler(make_doc)) server = Server({'/bkapp': app}, io_loop=IOLoop.current()) server.start()
CodeHandler
运行修改文档的源代码
__init__
source (str) -- python源代码
filename (str) -- 在任何调试或错误输出中使用的文件名
argv (list[str], optional) -- 作为可用的字符串参数列表 sys.argv 当代码执行时
sys.argv
modify_document
url_path
配置的文件名的基名的最后一个路径组件。
error
如果处理程序失败,则可能包含相关的错误消息。
error_detail
如果处理程序失败,则可能包含回溯或其他详细信息。
failed
True 如果处理程序修改单据失败
True
safe_to_fork
Bokeh服务器是否仍能安全地分配新员工。
False 如果代码已经被执行。
False