本文整理汇总了Python中bottle.default_app方法的典型用法代码示例。如果您正苦于以下问题:Python bottle.default_app方法的具体用法?Python bottle.default_app怎么用?Python bottle.default_app使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bottle
的用法示例。
在下文中一共展示了bottle.default_app方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: work
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [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: main
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [as 别名]
def main():
"""Function run when the tool is called."""
args = parse_args()
print(__doc__)
application = default_app()
application.mount('/cgi/', webapp.application)
run(host=args.bind_address, port=args.port, debug=DEBUG)
示例3: init
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [as 别名]
def init():
""" Init the application and add routes """
logging.basicConfig(format='%(asctime)s: [%(levelname)s]: %(message)s',
level=logging.DEBUG)
global theconfig
theconfig = get_config()
global rc
rc = init_redis(theconfig)
app = default_app()
return app
示例4: wsgi_app
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [as 别名]
def wsgi_app():
"""Returns the application to make available through wfastcgi. This is used
when the site is published to Microsoft Azure."""
return bottle.default_app()
示例5: main
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [as 别名]
def main():
""" Prepares and launches the bottle app. """
if (arguments['init']):
init_config(arguments['<username>'])
elif (arguments['run']):
app = bottle.default_app()
if 'HTTPPrefix' in config:
app.mount(config['HTTPPrefix'], app)
app.run(port=config['Port'], host=config['BindAddress'])
elif (arguments['list']):
print_list()
示例6: main
# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import default_app [as 别名]
def main():
init_log(level=logging.DEBUG)
app = default_app()
server = make_server(("", 8888), app)
server.serve_forever()