def __init__(self, request=None, response=None):
"""Calls the constructor of the super and does the local setup."""
super(InitHandler, self).__init__(request, response)
self.client = pubsub_utils.get_client()
# self._setup_topic()
self._setup_subscription()
# def _setup_topic(self):
# """Creates a topic if it does not exist."""
# topic_name = pubsub_utils.get_full_topic_name()
# try:
# self.client.projects().topics().get(
# topic=topic_name).execute()
# except errors.HttpError as e:
# if e.resp.status == 404:
# self.client.projects().topics().create(
# name=topic_name, body={}).execute()
# else:
# logging.exception(e)
# raise
评论列表
文章目录