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


Python app_identity.Error方法代碼示例

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


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

示例1: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, http_request):
    """Refreshes the access_token.

    Since the underlying App Engine app_identity implementation does its own
    caching we can skip all the storage hoops and just to a refresh using the
    API.

    Args:
      http_request: callable, a callable that matches the method signature of
        httplib2.Http.request, used to make the refresh request.

    Raises:
      AccessTokenRefreshError: When the refresh fails.
    """
    try:
      scopes = self.scope.split()
      (token, _) = app_identity.get_access_token(
          scopes, service_account_id=self.service_account_id)
    except app_identity.Error as e:
      raise AccessTokenRefreshError(str(e))
    self.access_token = token 
開發者ID:mortcanty,項目名稱:earthengine,代碼行數:23,代碼來源:appengine.py

示例2: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, http_request):
    """Refreshes the access_token.

    Since the underlying App Engine app_identity implementation does its own
    caching we can skip all the storage hoops and just to a refresh using the
    API.

    Args:
      http_request: callable, a callable that matches the method signature of
        httplib2.Http.request, used to make the refresh request.

    Raises:
      AccessTokenRefreshError: When the refresh fails.
    """
    try:
      scopes = self.scope.split()
      (token, _) = app_identity.get_access_token(scopes)
    except app_identity.Error, e:
      raise AccessTokenRefreshError(str(e)) 
開發者ID:splunk,項目名稱:splunk-ref-pas-code,代碼行數:21,代碼來源:appengine.py

示例3: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, http_request):
        """Refreshes the access_token.

        Since the underlying App Engine app_identity implementation does its
        own caching we can skip all the storage hoops and just to a refresh
        using the API.

        Args:
            http_request: callable, a callable that matches the method
                          signature of httplib2.Http.request, used to make the
                          refresh request.

        Raises:
            AccessTokenRefreshError: When the refresh fails.
        """
        try:
            scopes = self.scope.split()
            (token, _) = app_identity.get_access_token(
                scopes, service_account_id=self.service_account_id)
        except app_identity.Error as e:
            raise AccessTokenRefreshError(str(e))
        self.access_token = token 
開發者ID:Deltares,項目名稱:aqua-monitor,代碼行數:24,代碼來源:appengine.py

示例4: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, http_request):
        """Refreshes the access_token.

        Since the underlying App Engine app_identity implementation does its
        own caching we can skip all the storage hoops and just to a refresh
        using the API.

        Args:
            http_request: callable, a callable that matches the method
                          signature of httplib2.Http.request, used to make the
                          refresh request.

        Raises:
            AccessTokenRefreshError: When the refresh fails.
        """
        try:
            scopes = self.scope.split()
            (token, _) = app_identity.get_access_token(
                scopes, service_account_id=self.service_account_id)
        except app_identity.Error as e:
            raise client.AccessTokenRefreshError(str(e))
        self.access_token = token 
開發者ID:fniephaus,項目名稱:alfred-gmail,代碼行數:24,代碼來源:appengine.py

示例5: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, http):
        """Refreshes the access token.

        Since the underlying App Engine app_identity implementation does its
        own caching we can skip all the storage hoops and just to a refresh
        using the API.

        Args:
            http: unused HTTP object

        Raises:
            AccessTokenRefreshError: When the refresh fails.
        """
        try:
            scopes = self.scope.split()
            (token, _) = app_identity.get_access_token(
                scopes, service_account_id=self.service_account_id)
        except app_identity.Error as e:
            raise client.AccessTokenRefreshError(str(e))
        self.access_token = token 
開發者ID:haynieresearch,項目名稱:jarvis,代碼行數:22,代碼來源:appengine.py

示例6: Get

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def Get(cls, *args, **kwds):
        try:
            return cls(*args, **kwds)
        except exceptions.Error:
            return None 
開發者ID:google,項目名稱:apitools,代碼行數:7,代碼來源:credentials_lib.py

示例7: _refresh

# 需要導入模塊: from google.appengine.api import app_identity [as 別名]
# 或者: from google.appengine.api.app_identity import Error [as 別名]
def _refresh(self, _):
        """Refresh self.access_token.

        Args:
          _: (ignored) A function matching httplib2.Http.request's signature.
        """
        # pylint: disable=import-error
        from google.appengine.api import app_identity
        try:
            token, _ = app_identity.get_access_token(self._scopes)
        except app_identity.Error as e:
            raise exceptions.CredentialsError(str(e))
        self.access_token = token 
開發者ID:google,項目名稱:apitools,代碼行數:15,代碼來源:credentials_lib.py


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