本文整理汇总了Python中bottle.TEMPLATE_PATH.insert方法的典型用法代码示例。如果您正苦于以下问题:Python TEMPLATE_PATH.insert方法的具体用法?Python TEMPLATE_PATH.insert怎么用?Python TEMPLATE_PATH.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bottle.TEMPLATE_PATH
的用法示例。
在下文中一共展示了TEMPLATE_PATH.insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: work
# 需要导入模块: from bottle import TEMPLATE_PATH [as 别名]
# 或者: from bottle.TEMPLATE_PATH import insert [as 别名]
def work(p,rp,nonesym,timec,timebg,btc,btbg,etc,etbg,showetflag,showbtflag):
global port, static_path, nonesymbol, timecolor, timebackground, btcolor, btbackground, etcolor, etbackground, showbt, showet
port = p
static_path = rp
nonesymbol = nonesym
timecolor = timec
timebackground = timebg
btcolor = btc
btbackground = btbg
etcolor = etc
etbackground = etbg
showet = showetflag
showbt = showbtflag
TEMPLATE_PATH.insert(0,rp)
s = WSGIServer(("0.0.0.0", p), default_app(), handler_class=WebSocketHandler)
s.serve_forever()
示例2: __init__
# 需要导入模块: from bottle import TEMPLATE_PATH [as 别名]
# 或者: from bottle.TEMPLATE_PATH import insert [as 别名]
def __init__(self, infoscreen, folder, apiport):
super(InfoScreenWebServer, self).__init__()
# We need access to the infoscreen base object in order to manipulate it
self.infoscreen = infoscreen.base
# Get the folder path so we can build paths to templates etc.
self.folder = folder
# Set up the api
self.api = "http://localhost:{}/api/".format(apiport)
# Set up templates
tpls = os.path.join(self.folder, "web", "templates")
TEMPLATE_PATH.insert(0, tpls)
# Initialise dictionary for custom web pages provided by screens
self.custom_screens = {}
# Build the dictionary of available screens
self.process_plugins()
# Define our routes
self.route("/configure/<screen>", callback=self.update_config, method="GET")
self.route("/configure/<screen>", callback=self.save_config, method="POST")
self.route("/view/<screen>", callback=self.view)
self.route("/", callback=self.list_screens, method=["GET", "POST"])
# See if there are any custom screens
self.add_custom_routes()