def __init__(self, ldb, config = False):
super(GoogleStorage, self).__init__(ldb, config)
if not config:
# okay .. not in config (ask_config() method)
# load credentials and authenticate
self.scopes = ['https://www.googleapis.com/auth/devstorage.read_write']
self.credentials = ServiceAccountCredentials.from_json_keyfile_name(
self.ldb.sm_gs_json_creds_file,
scopes=self.scopes)
self.service = discovery.build('storage', 'v1', credentials=self.credentials)
评论列表
文章目录