diff --git a/github/Branch.py b/github/Branch.py index 72d9e8c0..07f615fd 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -42,6 +42,7 @@ import github.RequiredStatusChecks import Consts + class Branch(github.GithubObject.NonCompletableGithubObject): """ This class represents Branches. The reference can be found here https://developer.github.com/v3/repos/branches diff --git a/github/GithubObject.py b/github/GithubObject.py index 60ed6c65..af8587e2 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -47,6 +47,8 @@ class _NotSetType: return "NotSet" value = None + + NotSet = _NotSetType() diff --git a/github/MainClass.py b/github/MainClass.py index 9d4dd68e..de81b204 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -796,4 +796,3 @@ class GithubIntegration(object): ) response_dict = response.json() return Installation.Installation(None, headers, response_dict, True) - diff --git a/github/Migration.py b/github/Migration.py index 3f6a623c..fc14be6f 100644 --- a/github/Migration.py +++ b/github/Migration.py @@ -39,6 +39,7 @@ import github.NamedUser import Consts + class Migration(github.GithubObject.CompletableGithubObject): """ This class represents Migrations. The reference can be found here http://developer.github.com/v3/migrations/ diff --git a/github/NamedUser.py b/github/NamedUser.py index b1a1af22..8286859f 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -336,6 +336,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject): """ self._completeIfNotSet(self._repos_url) return self._repos_url.value + @property def role(self): """ @@ -736,7 +737,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject): self._received_events_url = self._makeStringAttribute(attributes["received_events_url"]) if "repos_url" in attributes: # pragma no branch self._repos_url = self._makeStringAttribute(attributes["repos_url"]) - if "role" in attributes: # pragma no branch + if "role" in attributes: # pragma no branch self._role = self._makeStringAttribute(attributes["role"]) if "site_admin" in attributes: # pragma no branch self._site_admin = self._makeBoolAttribute(attributes["site_admin"]) diff --git a/github/Organization.py b/github/Organization.py index d3fdafd0..8a89752d 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -55,6 +55,7 @@ import github.NamedUser import Consts + class Organization(github.GithubObject.CompletableGithubObject): """ This class represents Organizations. The reference can be found here http://developer.github.com/v3/orgs/ diff --git a/github/ProjectCard.py b/github/ProjectCard.py index f45a913c..8b52f2c9 100644 --- a/github/ProjectCard.py +++ b/github/ProjectCard.py @@ -29,6 +29,8 @@ import github.GithubObject # # See also https://developer.github.com/v4/object/projectcard for the next generation GitHub API, # which may point the way to where the API is likely headed and what might come back to v3. E.g. ProjectCard.content member. + + class ProjectCard(github.GithubObject.CompletableGithubObject): """ This class represents Project Cards. The reference can be found here https://developer.github.com/v3/projects/cards @@ -115,9 +117,9 @@ class ProjectCard(github.GithubObject.CompletableGithubObject): :calls: `GET /repos/:owner/:repo/pulls/:number `_ :rtype: :class:`github.PullRequest.PullRequest` or :class:`github.Issue.Issue` """ - if self.content_url == None: + if self.content_url is None: return None - + if content_type == "PullRequest": headers, data = self._requester.requestJsonAndCheck( "GET", diff --git a/github/ProjectColumn.py b/github/ProjectColumn.py index b00f6bac..41a9658a 100644 --- a/github/ProjectColumn.py +++ b/github/ProjectColumn.py @@ -171,4 +171,3 @@ class ProjectColumn(github.GithubObject.CompletableGithubObject): self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"]) if "url" in attributes: # pragma no branch self._url = self._makeStringAttribute(attributes["url"]) - diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 05b438e8..e8636114 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -39,6 +39,7 @@ import github.NamedUser import Consts + class PullRequestComment(github.GithubObject.CompletableGithubObject): """ This class represents PullRequestComments. The reference can be found here http://developer.github.com/v3/pulls/comments/ diff --git a/github/RateLimit.py b/github/RateLimit.py index b134b755..8fc78e40 100644 --- a/github/RateLimit.py +++ b/github/RateLimit.py @@ -43,9 +43,9 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject): @property @deprecated(reason=""" - The rate object is deprecated. If you're writing new API client code - or updating existing code, you should use the core object instead of - the rate object. The core object contains the same information that + The rate object is deprecated. If you're writing new API client code + or updating existing code, you should use the core object instead of + the rate object. The core object contains the same information that is present in the rate object. """) def rate(self): diff --git a/github/Repository.py b/github/Repository.py index 8abdc897..fc74017a 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1810,7 +1810,6 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters ) - def get_download(self, id): """ :calls: `GET /repos/:owner/:repo/downloads/:id `_ diff --git a/github/Requester.py b/github/Requester.py index 951940e3..6eb51e8d 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -87,6 +87,7 @@ class RequestsResponse: def read(self): return self.text + class HTTPSRequestsConnectionClass(object): # mimic the httplib connection object def __init__(self, host, port=None, strict=False, timeout=None, retry=None, **kwargs): @@ -294,9 +295,9 @@ class Requester: (o.port and o.port != self.__port) or \ (o.scheme != self.__scheme and not (o.scheme == "https" and self.__scheme == "http")): # issue80 if o.scheme == 'http': - cnx = self.__httpConnectionClass(o.hostname, o.port, retry = self.__retry) + cnx = self.__httpConnectionClass(o.hostname, o.port, retry=self.__retry) elif o.scheme == 'https': - cnx = self.__httpsConnectionClass(o.hostname, o.port, retry = self.__retry) + cnx = self.__httpsConnectionClass(o.hostname, o.port, retry=self.__retry) return cnx def __createException(self, status, headers, output): @@ -307,8 +308,8 @@ class Requester: elif status == 403 and output.get("message").startswith("Missing or invalid User Agent string"): cls = GithubException.BadUserAgentException elif status == 403 and ( - output.get("message").lower().startswith("api rate limit exceeded") - or output.get("message").lower().endswith("please wait a few minutes before you try again.") + output.get("message").lower().startswith("api rate limit exceeded") or + output.get("message").lower().endswith("please wait a few minutes before you try again.") ): cls = GithubException.RateLimitExceededException elif status == 404 and output.get("message") == "Not Found": @@ -470,7 +471,7 @@ class Requester: if self.__persist and self.__connection is not None: return self.__connection - self.__connection = self.__connectionClass(self.__hostname, self.__port, retry = self.__retry, **kwds) + self.__connection = self.__connectionClass(self.__hostname, self.__port, retry=self.__retry, **kwds) return self.__connection diff --git a/github/Team.py b/github/Team.py index f3bd255c..a5d56a66 100644 --- a/github/Team.py +++ b/github/Team.py @@ -50,6 +50,7 @@ import github.Organization import Consts + class Team(github.GithubObject.CompletableGithubObject): """ This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/