def build_service(self):
"""
Build service for connect to google fusiontables.
"""
logger.info('Build service for connect to google fusiontables server.')
try:
credentials = ServiceAccountCredentials.from_json_keyfile_name(
self.PATH_TO_KEY,
scopes=['https://www.googleapis.com/auth/fusiontables']
)
http_auth = credentials.authorize(Http())
except IOError:
raise IncorrectAccessFilePathException(
"Access key path '{0}' is incorrect.".format(
self.PATH_TO_KEY
)
)
self.SERVICE = build('fusiontables', 'v2', http=http_auth)
评论列表
文章目录