當前位置: 首頁>>代碼示例>>Python>>正文


Python handlers.BaseHandler方法代碼示例

本文整理匯總了Python中jupyterhub.handlers.BaseHandler方法的典型用法代碼示例。如果您正苦於以下問題:Python handlers.BaseHandler方法的具體用法?Python handlers.BaseHandler怎麽用?Python handlers.BaseHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jupyterhub.handlers的用法示例。


在下文中一共展示了handlers.BaseHandler方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_next_url

# 需要導入模塊: from jupyterhub import handlers [as 別名]
# 或者: from jupyterhub.handlers import BaseHandler [as 別名]
def get_next_url(self, user=None):
        """Get the redirect target from the state field"""
        state = self.get_state_url()
        if state:
            next_url = _deserialize_state(state).get('next_url')
            if next_url:
                return next_url
        # JupyterHub 0.8 adds default .get_next_url for a fallback
        if hasattr(BaseHandler, 'get_next_url'):
            return super().get_next_url(user)
        return url_path_join(self.hub.server.base_url, 'home') 
開發者ID:jupyterhub,項目名稱:oauthenticator,代碼行數:13,代碼來源:oauth2.py

示例2: finish

# 需要導入模塊: from jupyterhub import handlers [as 別名]
# 或者: from jupyterhub.handlers import BaseHandler [as 別名]
def finish(self):
        return super(JupyterHubBaseHandler, self).finish() 
開發者ID:jupyterhub,項目名稱:hubshare,代碼行數:4,代碼來源:handlers.py

示例3: post

# 需要導入模塊: from jupyterhub import handlers [as 別名]
# 或者: from jupyterhub.handlers import BaseHandler [as 別名]
def post(self):
        """
        Technical reference of relevance to understand this function
        ------------------------------------------------------------
        1. Class dependencies
           - jupyterhub.handlers.BaseHandler: https://github.com/jupyterhub/jupyterhub/blob/abb93ad799865a4b27f677e126ab917241e1af72/jupyterhub/handlers/base.py#L69
           - tornado.web.RequestHandler: https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler
        2. Function dependencies
           - login_user: https://github.com/jupyterhub/jupyterhub/blob/abb93ad799865a4b27f677e126ab917241e1af72/jupyterhub/handlers/base.py#L696-L715
             login_user is defined in the JupyterHub wide BaseHandler class,
             mainly wraps a call to the authenticate function and follow up.
             a successful authentication with a call to auth_to_user that
             persists a JupyterHub user and returns it.
           - get_next_url: https://github.com/jupyterhub/jupyterhub/blob/abb93ad799865a4b27f677e126ab917241e1af72/jupyterhub/handlers/base.py#L587
           - get_body_argument: https://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.get_body_argument
        """
        # FIXME: Figure out if we want to pass the user returned from
        #        self.login_user() to self.get_next_url(). It is named
        #        _ for now as pyflakes is fine about having an unused
        #        variable named _.
        _ = yield self.login_user()
        next_url = self.get_next_url()
        body_argument = self.get_body_argument(
            name='custom_next',
            default=next_url,
        )

        self.redirect(body_argument) 
開發者ID:jupyterhub,項目名稱:ltiauthenticator,代碼行數:30,代碼來源:__init__.py


注:本文中的jupyterhub.handlers.BaseHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。