當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。