def activate(self):
super().activate()
self.outdir = self.bot_config.BOT_DATA_DIR
# servacc.json is the service account credentials you can download from
# your project on cloud console.
# TODO(gbin): make that more user friendly.
try:
servacc_file = self.bot_config.GOOGLE_SERVICE_ACCOUNT
except AttributeError:
servacc_file = os.path.join(self.outdir, 'servacc.json')
self.credentials = GoogleCredentials.from_stream(servacc_file)
self.storage = build('storage', 'v1', credentials=self.credentials)
评论列表
文章目录