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


Python bottle.debug方法代码示例

本文整理汇总了Python中bottle.debug方法的典型用法代码示例。如果您正苦于以下问题:Python bottle.debug方法的具体用法?Python bottle.debug怎么用?Python bottle.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bottle的用法示例。


在下文中一共展示了bottle.debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: change_passwords

# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import debug [as 别名]
def change_passwords(username, old_pass, new_pass):
    changed = []

    for key in (key for key in CONF.sections()
                if key == 'ldap' or key.startswith('ldap:')):

        LOG.debug("Changing password in %s for %s" % (key, username))
        try:
            change_password(CONF[key], username, old_pass, new_pass)
            changed.append(key)
        except Error as e:
            for key in reversed(changed):
                LOG.info("Reverting password change in %s for %s" % (key, username))
                try:
                    change_password(CONF[key], username, new_pass, old_pass)
                except Error as e2:
                    LOG.error('{}: {!s}'.format(e.__class__.__name__, e2))
            raise e 
开发者ID:jirutka,项目名称:ldap-passwd-webui,代码行数:20,代码来源:app.py

示例2: nif_api

# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import debug [as 别名]
def nif_api(*args, **kwargs):
    content_format = request.headers.get('Content') or 'application/x-turtle'
    content_type_to_format = {
        'application/x-turtle': 'turtle',
        'text/turtle': 'turtle',
    }
    nif_body = request.body.read()
    nif_doc = NIFCollection.loads(nif_body)
    for context in nif_doc.contexts:
        logger.debug(context.mention)
        mentions = classifier.create_mentions(context.mention)
        classifier.classify_mentions(mentions)
        for mention in mentions:
            mention.add_phrase_to_nif_context(context)

    response.set_header('content-type', content_format)
    return nif_doc.dumps() 
开发者ID:wetneb,项目名称:opentapioca,代码行数:19,代码来源:app.py

示例3: run

# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import debug [as 别名]
def run():
  bottle.debug(not PROD)
  bottle.run(
    app=app, 
    host='localhost',
    port='2081',
    reloader=not PROD
  ) 
开发者ID:keredson,项目名称:bottle-react,代码行数:10,代码来源:run.py

示例4: serve

# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import debug [as 别名]
def serve(server='wsgiref', port=8800, reloader=False, debugmode=False):
    """
    Build the html and js files, if needed, then launch the app.

    The default server is the single-threaded 'wsgiref' server that comes with
    Python. It's fine for a demo, but for production you'll want to use
    something better, e.g. server='cherrypy'. For an extensive list of server
    options, see http://bottlepy.org/docs/dev/deployment.html
    """
    bottle.debug(debugmode)

    ## Client side tracks _state['server_start_time']
    ## to decide if it should reload.
    _state['server_start_time'] = time.time()

    ## rebuild as needed
    doBuild()

    ## Launch the web service loop.
    bottle.run(app,
               host='0.0.0.0',
               server=server,
               port=port,
               reloader=reloader,
               debug=debugmode)

###################################################
## The following runs only when we start from
## the command line.
################################################### 
开发者ID:Michael-F-Ellis,项目名称:NearlyPurePythonWebAppDemo,代码行数:32,代码来源:server.py

示例5: serve

# 需要导入模块: import bottle [as 别名]
# 或者: from bottle import debug [as 别名]
def serve(server='wsgiref', port=8800, reloader=False, debugmode=False):
        """
        Build the html and js files, if needed, then launch the app.

        The default server is the single-threaded 'wsgiref' server that comes with
        Python. It's fine for a demo, but for production you'll want to use
        something better, e.g. server='cherrypy'. For an extensive list of server
        options, see http://bottlepy.org/docs/dev/deployment.html
        """
        bottle.debug(debugmode)

        ## Client side tracks _state['server_start_time']
        ## to decide if it should reload.
        _state['server_start_time'] = time.time()

        ## rebuild as needed
        doBuild()

        ## Launch the web service loop.
        bottle.run(app,
                   host='0.0.0.0',
                   server=server,
                   port=port,
                   reloader=reloader,
                   debug=debugmode)

    ## The following runs only when we start from
    ## the command line. 
开发者ID:Michael-F-Ellis,项目名称:NearlyPurePythonWebAppDemo,代码行数:30,代码来源:allinone.py


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