def make_githup_api_factory(cfg):
"""Simple factory for making the GitHub API client factory
:param cfg: Configuration of the application
:type cfg: ``configparser.ConfigParser``
:return: GitHub API client factory
:rtype: ``function``
"""
def github_api_factory(token=None, session=None):
return GitHubAPI(
cfg.get('github', 'client_id'),
cfg.get('github', 'client_secret'),
cfg.get('github', 'webhooks_secret'),
session=session,
token=token
)
return github_api_factory
评论列表
文章目录