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


Python client.Flow方法代碼示例

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


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

示例1: _create_flow

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def _create_flow(self, request_handler):
    """Create the Flow object.

    The Flow is calculated lazily since we don't know where this app is
    running until it receives a request, at which point redirect_uri can be
    calculated and then the Flow object can be constructed.

    Args:
      request_handler: webapp.RequestHandler, the request handler.
    """
    if self.flow is None:
      redirect_uri = request_handler.request.relative_url(
          self._callback_path) # Usually /oauth2callback
      self.flow = OAuth2WebServerFlow(self._client_id, self._client_secret,
                                      self._scope, redirect_uri=redirect_uri,
                                      user_agent=self._user_agent,
                                      auth_uri=self._auth_uri,
                                      token_uri=self._token_uri,
                                      revoke_uri=self._revoke_uri,
                                      **self._kwargs) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:22,代碼來源:appengine.py

示例2: _create_flow

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def _create_flow(self, request_handler):
        """Create the Flow object.

        The Flow is calculated lazily since we don't know where this app is
        running until it receives a request, at which point redirect_uri can be
        calculated and then the Flow object can be constructed.

        Args:
            request_handler: webapp.RequestHandler, the request handler.
        """
        if self.flow is None:
            redirect_uri = request_handler.request.relative_url(
                self._callback_path)  # Usually /oauth2callback
            self.flow = OAuth2WebServerFlow(
                self._client_id, self._client_secret, self._scope,
                redirect_uri=redirect_uri, user_agent=self._user_agent,
                auth_uri=self._auth_uri, token_uri=self._token_uri,
                revoke_uri=self._revoke_uri, **self._kwargs) 
開發者ID:Deltares,項目名稱:aqua-monitor,代碼行數:20,代碼來源:appengine.py

示例3: _create_flow

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def _create_flow(self, request_handler):
        """Create the Flow object.

        The Flow is calculated lazily since we don't know where this app is
        running until it receives a request, at which point redirect_uri can be
        calculated and then the Flow object can be constructed.

        Args:
            request_handler: webapp.RequestHandler, the request handler.
        """
        if self.flow is None:
            redirect_uri = request_handler.request.relative_url(
                self._callback_path)  # Usually /oauth2callback
            self.flow = client.OAuth2WebServerFlow(
                self._client_id, self._client_secret, self._scope,
                redirect_uri=redirect_uri, user_agent=self._user_agent,
                auth_uri=self._auth_uri, token_uri=self._token_uri,
                revoke_uri=self._revoke_uri, **self._kwargs) 
開發者ID:fniephaus,項目名稱:alfred-gmail,代碼行數:20,代碼來源:appengine.py

示例4: validate

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def validate(self, value):
    if value is not None and not isinstance(value, Flow):
      raise db.BadValueError('Property %s must be convertible '
                          'to a FlowThreeLegged instance (%s)' %
                          (self.name, value))
    return super(FlowProperty, self).validate(value) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:8,代碼來源:appengine.py

示例5: _validate

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def _validate(self, value):
      """Validates a value as a proper Flow object.

      Args:
        value: A value to be set on the property.

      Raises:
        TypeError if the value is not an instance of Flow.
      """
      logger.info('validate: Got type %s', type(value))
      if value is not None and not isinstance(value, Flow):
        raise TypeError('Property %s must be convertible to a flow '
                        'instance; received: %s.' % (self._name, value)) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:15,代碼來源:appengine.py

示例6: get_flow

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def get_flow(self):
    """A thread local Flow object.

    Returns:
      A credentials.Flow object, or None if the flow hasn't been set in this
      thread yet, which happens in _create_flow() since Flows are created
      lazily.
    """
    return getattr(self._tls, 'flow', None) 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:11,代碼來源:appengine.py

示例7: validate

# 需要導入模塊: from oauth2client import client [as 別名]
# 或者: from oauth2client.client import Flow [as 別名]
def validate(self, value):
        if value is not None and not isinstance(value, Flow):
            raise db.BadValueError('Property %s must be convertible '
                                   'to a FlowThreeLegged instance (%s)' %
                                   (self.name, value))
        return super(FlowProperty, self).validate(value) 
開發者ID:Deltares,項目名稱:aqua-monitor,代碼行數:8,代碼來源:appengine.py


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