Update Repository.py

This commit is contained in:
AKFish
2013-08-21 17:13:03 +08:00
parent 0e842637a6
commit 3c1d17cd64
9 changed files with 18 additions and 17 deletions
+3 -3
View File
@@ -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):
"""
+5 -1
View File
@@ -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"]
+1 -1
View File
@@ -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"]
+1 -1
View File
@@ -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):
"""
+1 -1
View File
@@ -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):
"""
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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):
"""
+1 -1
View File
@@ -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"]
+2 -5
View File
@@ -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"]