diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 75caa57c..6fd4c16b 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -363,7 +363,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def create_gist(self, public, files, description=github.GithubObject.NotSet): """ @@ -459,7 +459,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def edit(self, name=github.GithubObject.NotSet, email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, location=github.GithubObject.NotSet, hireable=github.GithubObject.NotSet, bio=github.GithubObject.NotSet): """ @@ -771,7 +771,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def get_repos(self, type=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): """ diff --git a/github/Event.py b/github/Event.py index cd45e14c..aefc3ca9 100644 --- a/github/Event.py +++ b/github/Event.py @@ -123,10 +123,14 @@ class Event(github.GithubObject.NonCompletableGithubObject): self._public = attributes["public"] if "repo" in attributes: # pragma no branch assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] - self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, attributes["repo"], completed=False) + self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, self._headers, attributes["repo"], completed=False) if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] self._type = attributes["type"] + + + + diff --git a/github/Issue.py b/github/Issue.py index ec3923b9..01bffcfd 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -415,7 +415,7 @@ class Issue(github.GithubObject.CompletableGithubObject): self._pull_request = None if attributes["pull_request"] is None else github.IssuePullRequest.IssuePullRequest(self._requester, self._headers, attributes["pull_request"], completed=False) if "repository" in attributes: # pragma no branch assert attributes["repository"] is None or isinstance(attributes["repository"], dict), attributes["repository"] - self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, attributes["repository"], completed=False) + self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, self._headers, attributes["repository"], completed=False) if "state" in attributes: # pragma no branch assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] self._state = attributes["state"] diff --git a/github/MainClass.py b/github/MainClass.py index 44e22df1..2b1db292 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -168,7 +168,7 @@ class Github(object): None, None ) - return Repository.Repository(self.__requester, data, completed=True) + return Repository.Repository(self.__requester, headers, data, completed=True) def get_gist(self, id): """ diff --git a/github/NamedUser.py b/github/NamedUser.py index 7bfa3ff1..09927bae 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -394,7 +394,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def get_repos(self, type=github.GithubObject.NotSet): """ diff --git a/github/Notification.py b/github/Notification.py index f6f89fa5..58957495 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -104,7 +104,7 @@ class Notification(github.GithubObject.CompletableGithubObject): self._id = attributes["id"] if "repository" in attributes: # pragma no branch assert attributes["repository"] is None or isinstance(attributes["repository"], dict), attributes["repository"] - self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, attributes["repository"], completed=False) + self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, self._headers, attributes["repository"], completed=False) if "subject" in attributes: # pragma no branch assert attributes["subject"] is None or isinstance(attributes["subject"], dict), attributes["subject"] self._subject = None if attributes["subject"] is None else github.NotificationSubject.NotificationSubject(self._requester, self._headers, attributes["subject"], completed=False) diff --git a/github/Organization.py b/github/Organization.py index bf341419..43112110 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -264,7 +264,7 @@ class Organization(github.GithubObject.CompletableGithubObject): url_parameters, None ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def create_repo(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, private=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, team_id=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet): """ @@ -318,7 +318,7 @@ class Organization(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def create_team(self, name, repo_names=github.GithubObject.NotSet, permission=github.GithubObject.NotSet): """ @@ -471,7 +471,7 @@ class Organization(github.GithubObject.CompletableGithubObject): None, None ) - return github.Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, headers, data, completed=True) def get_repos(self, type=github.GithubObject.NotSet): """ diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 837b7bf0..3c770025 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -85,7 +85,7 @@ class PullRequestPart(github.GithubObject.NonCompletableGithubObject): self._ref = attributes["ref"] if "repo" in attributes: # pragma no branch assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] - self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, attributes["repo"], completed=False) + self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, self._headers, attributes["repo"], completed=False) if "sha" in attributes: # pragma no branch assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] diff --git a/github/Repository.py b/github/Repository.py index 5c305d9e..b4bbb476 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -65,9 +65,6 @@ class Repository(github.GithubObject.CompletableGithubObject): """ This class represents Repositorys. The reference can be found here http://developer.github.com/v3/repos/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def clone_url(self): @@ -1719,7 +1716,7 @@ class Repository(github.GithubObject.CompletableGithubObject): self._owner = None if attributes["owner"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["owner"], completed=False) if "parent" in attributes: # pragma no branch assert attributes["parent"] is None or isinstance(attributes["parent"], dict), attributes["parent"] - self._parent = None if attributes["parent"] is None else Repository(self._requester, attributes["parent"], completed=False) + self._parent = None if attributes["parent"] is None else Repository(self._requester, self._headers, attributes["parent"], completed=False) if "permissions" in attributes: # pragma no branch assert attributes["permissions"] is None or isinstance(attributes["permissions"], dict), attributes["permissions"] self._permissions = None if attributes["permissions"] is None else github.Permissions.Permissions(self._requester, self._headers, attributes["permissions"], completed=False) @@ -1734,7 +1731,7 @@ class Repository(github.GithubObject.CompletableGithubObject): self._size = attributes["size"] if "source" in attributes: # pragma no branch assert attributes["source"] is None or isinstance(attributes["source"], dict), attributes["source"] - self._source = None if attributes["source"] is None else Repository(self._requester, attributes["source"], completed=False) + self._source = None if attributes["source"] is None else Repository(self._requester, self._headers, attributes["source"], completed=False) if "ssh_url" in attributes: # pragma no branch assert attributes["ssh_url"] is None or isinstance(attributes["ssh_url"], (str, unicode)), attributes["ssh_url"] self._ssh_url = attributes["ssh_url"]