当前位置: 首页>>代码示例>>Python>>正文


Python TEMPLATE_PATH.insert方法代码示例

本文整理汇总了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() 
开发者ID:artisan-roaster-scope,项目名称:artisan,代码行数:18,代码来源:weblcds.py

示例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() 
开发者ID:elParaguayo,项目名称:RPi-InfoScreen-Kivy,代码行数:32,代码来源:webinterface.py


注:本文中的bottle.TEMPLATE_PATH.insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。