Exemplo n.º 1
0
Arquivo: demos.py Projeto: 235/Bokeh
 def inner_f():
     plot = f()
     if isinstance(plot, str):
         output = plot
     else:
         output = plot.script_direct_inject(
             os.path.join(_basedir, "../static/demos"))
     return generate_func_docs(f, output)
Exemplo n.º 2
0
def page_desc(prev_infos, f):
    if len(prev_infos) > 0:
        prev_info = prev_infos[-1]
    else:
        prev_info = {}
    name_ = f.__name__
    #I need to make sure I know where to put this snippet, where I
    #want it written
    plot = f()
    embed_snippet = plot.script_direct_inject(demo_dir, static_path="../")
    page_info = dict(
        f=f, name=name_, embed_snippet=embed_snippet,
        detail_snippet = generate_func_docs(f, embed_snippet),
        detail_page_url=name_ + ".html",
        prev_detail_url=prev_info.get('detail_page_url', ""),
        prev_detail_name=prev_info.get('name', ""))
    if len(prev_infos) == 0:
        prev_infos = [page_info]
    else:
        prev_infos.append(page_info)

    return prev_infos
Exemplo n.º 3
0
def page_desc(prev_infos, f):
    if len(prev_infos) > 0:
        prev_info = prev_infos[-1]
    else:
        prev_info = {}
    name_ = f.__name__
    #I need to make sure I know where to put this snippet, where I
    #want it written
    plot = f()
    embed_snippet = plot.inject_snippet(
        embed_save_loc= detail_dir, static_path=HOSTED_STATIC_ROOT,
        embed_base_url=DETAIL_URL_ROOT)
    page_info = dict(
        f=f, name=name_, embed_snippet=embed_snippet,
        detail_snippet = generate_func_docs(f, ""),
        detail_page_url=DETAIL_URL_ROOT + name_ + ".html",
        prev_detail_url=prev_info.get('detail_page_url', ""),
        prev_detail_name=prev_info.get('name', ""))
    if len(prev_infos) == 0:
        prev_infos = [page_info]
    else:
        prev_infos.append(page_info)

    return prev_infos