# -----------------------------------------------------------------------------# Copyright (c) Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.# -----------------------------------------------------------------------------""" This modules simply provides some sample code for the documentation of``bokeh.sphinxext`` itself."""# -----------------------------------------------------------------------------# Boilerplate# -----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)# -----------------------------------------------------------------------------# Imports# -----------------------------------------------------------------------------# Bokeh importsfrombokeh.core.enumsimportenumerationfrombokeh.core.propertiesimport(Auto,Either,Enum,Float,Int,List,String,Tuple,)frombokeh.modelimportModelfrombokeh.util.optionsimportOptions# -----------------------------------------------------------------------------# Globals and constants# -----------------------------------------------------------------------------__all__=("Bar","baz","Foo","Opts",)# -----------------------------------------------------------------------------# General API# -----------------------------------------------------------------------------# -----------------------------------------------------------------------------# Dev API# -----------------------------------------------------------------------------
[docs]classFoo(Model):""" This is a Foo model. """index=Either(Auto,Enum("abc","def","xzy"),help="doc for index")value=Tuple(Float,Float,help="doc for value")
classBar(Model):""" This is a Bar model. """thing=List(Int,help="doc for thing")#: This is an enumerationbaz=enumeration("a","b","c")classOpts(Options):""" This is an Options class """host=String(default="localhost",help="a host to connect to")port=Int(default=5890,help="a port to connect to")# -----------------------------------------------------------------------------# Private API# -----------------------------------------------------------------------------# -----------------------------------------------------------------------------# Code# -----------------------------------------------------------------------------