#-----------------------------------------------------------------------------# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Standard library importsimportsysfromos.pathimport(abspath,dirname,isdir,join,normpath,realpath,)#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------# Root dir of Bokeh packageROOT_DIR=dirname(dirname(abspath(__file__)))__all__=('serverdir','bokehjsdir',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]defserverdir()->str:""" Get the location of the server subpackage """path=join(ROOT_DIR,'server')path=normpath(path)ifsys.platform=='cygwin':path=realpath(path)returnpath
[docs]defbokehjsdir(dev:bool=False)->str:""" Get the location of the bokehjs source files. If dev is True, the files in bokehjs/build are preferred. Otherwise uses the files in bokeh/server/static. """dir1=join(ROOT_DIR,'..','bokehjs','build')dir2=join(serverdir(),'static')ifdevandisdir(dir1):returndir1else:returndir2
#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------