From 63a57cb70d930d43768a41a9d41d6f04e6509546 Mon Sep 17 00:00:00 2001 From: Conor Branagan Date: Thu, 4 Oct 2012 16:07:19 -0400 Subject: [PATCH] Allow setting a timeout for services --- pygithub3/core/client.py | 2 ++ pygithub3/services/base.py | 1 + 2 files changed, 3 insertions(+) diff --git a/pygithub3/core/client.py b/pygithub3/core/client.py index 5f3a134..139bee8 100644 --- a/pygithub3/core/client.py +++ b/pygithub3/core/client.py @@ -56,6 +56,8 @@ def __set_params(self, config): self.requester.params.append(per_page) if config.get('verbose'): self.requester.config = {'verbose': config['verbose']} + if config.get('timeout'): + self.requester.timeout = config['timeout'] def __parse_kwargs(func): """ Decorator to put extra args into requests.params """ diff --git a/pygithub3/services/base.py b/pygithub3/services/base.py index b78eadc..def9d0a 100644 --- a/pygithub3/services/base.py +++ b/pygithub3/services/base.py @@ -18,6 +18,7 @@ class Service(object): :param int per_page: Items in each page of multiple returns :param str base_url: To support another github-related API (untested) :param stream verbose: Stream to write debug logs + :param timeout float: Timeout for requests You can configure the **authentication** with BasicAuthentication (login and password) and with `OAuth `_ (