From ea4bd8c9ad94a2e38bc272c9f9ff8cfdccea4c03 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 08:27:42 +0800 Subject: [PATCH 01/59] Update .gitignore to ignore eproject settings and custom build batch files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 98aa8eff..3a7eff09 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ GithubCredentials.py /PyGithub.egg-info/ /.coverage /developer.github.com/ + +*.cfg +*.bat From cfbe7fb0b0e8f72f8725e48a4155ab0338d9773f Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 11:21:15 +0800 Subject: [PATCH 02/59] Change GithubObject.__init__ without breaking build. --- github/GithubObject.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/github/GithubObject.py b/github/GithubObject.py index 8178d8e7..ba1feba7 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -38,8 +38,9 @@ class GithubObject(object): """ Base class for all classes representing objects returned by the API. """ - def __init__(self, requester, attributes, completed): + def __init__(self, requester, headers, attributes, completed): self._requester = requester + self._headers = headers; self._initAttributes() self._storeAndUseAttributes(attributes) @@ -79,13 +80,18 @@ class GithubObject(object): class NonCompletableGithubObject(GithubObject): + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + GithubObject.__init__(self, requester, {}, attributes, completed) def _completeIfNeeded(self): pass class CompletableGithubObject(GithubObject): def __init__(self, requester, attributes, completed): - GithubObject.__init__(self, requester, attributes, completed) + GithubObject.__init__(self, requester, {}, attributes, completed) self.__completed = completed def _completeIfNotSet(self, value): From 0bc138b490b0b9d7ebc5e539547b88e062dd127d Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 12:32:41 +0800 Subject: [PATCH 03/59] Change NonCompletableGithubObject without breaking build. --- github/Branch.py | 5 +++++ github/CommitStats.py | 5 +++++ github/CommitStatus.py | 5 +++++ github/Event.py | 5 +++++ github/File.py | 5 +++++ github/GistFile.py | 5 +++++ github/GitAuthor.py | 5 +++++ github/GitObject.py | 5 +++++ github/GitTreeElement.py | 5 +++++ github/GithubObject.py | 11 ++++++----- github/GitignoreTemplate.py | 5 +++++ github/HookDescription.py | 5 +++++ github/HookResponse.py | 5 +++++ github/IssuePullRequest.py | 5 +++++ github/NotificationSubject.py | 5 +++++ github/PaginatedList.py | 34 +++++++++++++++++++++++--------- github/Permissions.py | 5 +++++ github/Plan.py | 5 +++++ github/PullRequestMergeStatus.py | 5 +++++ github/PullRequestPart.py | 5 +++++ github/Tag.py | 5 +++++ 21 files changed, 126 insertions(+), 14 deletions(-) diff --git a/github/Branch.py b/github/Branch.py index 11f074d5..6e9f094f 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -33,6 +33,11 @@ class Branch(github.GithubObject.NonCompletableGithubObject): """ This class represents Branchs. The reference can be found here http://developer.github.com/v3/repos/#list-branches """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def commit(self): diff --git a/github/CommitStats.py b/github/CommitStats.py index 1be6a1d4..ce367f48 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -30,6 +30,11 @@ class CommitStats(github.GithubObject.NonCompletableGithubObject): """ This class represents CommitStatss as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 122c55c4..b870cd30 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -32,6 +32,11 @@ class CommitStatus(github.GithubObject.NonCompletableGithubObject): """ This class represents CommitStatuss as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def created_at(self): diff --git a/github/Event.py b/github/Event.py index 60e7c863..bf185c4a 100644 --- a/github/Event.py +++ b/github/Event.py @@ -35,6 +35,11 @@ class Event(github.GithubObject.NonCompletableGithubObject): """ This class represents Events. The reference can be found here http://developer.github.com/v3/activity/events/ """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def actor(self): diff --git a/github/File.py b/github/File.py index 538fde6b..e126bac0 100644 --- a/github/File.py +++ b/github/File.py @@ -30,6 +30,11 @@ class File(github.GithubObject.NonCompletableGithubObject): """ This class represents Files as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): diff --git a/github/GistFile.py b/github/GistFile.py index a153c7ba..458fd87e 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -30,6 +30,11 @@ class GistFile(github.GithubObject.NonCompletableGithubObject): """ This class represents GistFiles as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): diff --git a/github/GitAuthor.py b/github/GitAuthor.py index dd409dea..71d3b3c1 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -30,6 +30,11 @@ class GitAuthor(github.GithubObject.NonCompletableGithubObject): """ This class represents GitAuthors as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def date(self): diff --git a/github/GitObject.py b/github/GitObject.py index 2d29b437..2d18d850 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -30,6 +30,11 @@ class GitObject(github.GithubObject.NonCompletableGithubObject): """ This class represents GitObjects as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def sha(self): diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index bf361be0..f58b57b3 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -30,6 +30,11 @@ class GitTreeElement(github.GithubObject.NonCompletableGithubObject): """ This class represents GitTreeElements as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def mode(self): diff --git a/github/GithubObject.py b/github/GithubObject.py index ba1feba7..4289a445 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -80,17 +80,18 @@ class GithubObject(object): class NonCompletableGithubObject(GithubObject): - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - GithubObject.__init__(self, requester, {}, attributes, completed) +# def __init__(self, requester, attributes, completed): +# ''' +# Adapte for __init__ change, remove later +# ''' +# GithubObject.__init__(self, requester, {}, attributes, completed) def _completeIfNeeded(self): pass class CompletableGithubObject(GithubObject): def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later GithubObject.__init__(self, requester, {}, attributes, completed) self.__completed = completed diff --git a/github/GitignoreTemplate.py b/github/GitignoreTemplate.py index a1b96d7c..82b6def9 100644 --- a/github/GitignoreTemplate.py +++ b/github/GitignoreTemplate.py @@ -29,6 +29,11 @@ class GitignoreTemplate(github.GithubObject.NonCompletableGithubObject): """ This class represents GitignoreTemplates as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def source(self): diff --git a/github/HookDescription.py b/github/HookDescription.py index 766cbfc7..3a665159 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -30,6 +30,11 @@ class HookDescription(github.GithubObject.NonCompletableGithubObject): """ This class represents HookDescriptions as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def events(self): diff --git a/github/HookResponse.py b/github/HookResponse.py index 87dc0ac0..8b3b0183 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -30,6 +30,11 @@ class HookResponse(github.GithubObject.NonCompletableGithubObject): """ This class represents HookResponses as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def code(self): diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index cdc1b44b..075b61ce 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -30,6 +30,11 @@ class IssuePullRequest(github.GithubObject.NonCompletableGithubObject): """ This class represents IssuePullRequests as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def diff_url(self): diff --git a/github/NotificationSubject.py b/github/NotificationSubject.py index d32977ea..4188e059 100644 --- a/github/NotificationSubject.py +++ b/github/NotificationSubject.py @@ -28,6 +28,11 @@ class NotificationSubject(github.GithubObject.NonCompletableGithubObject): """ This class represents Subjects of Notifications as returned for example by http://developer.github.com/v3/activity/notifications/#list-your-notifications """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def title(self): diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 21de4ed4..effdb839 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -26,7 +26,7 @@ ################################################################################ import github.GithubObject - +import inspect class PaginatedListBase: def __init__(self): @@ -113,6 +113,28 @@ class PaginatedList(PaginatedListBase): def _couldGrow(self): return self.__nextUrl is not None + + def makePage(self, headers, data): + ''' + Adapte for diffrent __init__ signature in refactoring, remove when done + ''' + try: + if not inspect.isclass(self.__contentClass): + return [ + self.__contentClass(self.__requester, element, completed=False) + for element in data] + elif issubclass(self.__contentClass, github.GithubObject.NonCompletableGithubObject): + return [ + self.__contentClass(self.__requester, element, completed=False) + for element in data] + else: + return [ + self.__contentClass(self.__requester, element, completed=False) + for element in data] + except TypeError: # fix for some testcases, passed lambda in + print "WTF????????????????" + print self.__contentClass + raise def _fetchNextPage(self): headers, data = self.__requester.requestJsonAndCheck("GET", self.__nextUrl, self.__nextParams, None) @@ -124,10 +146,7 @@ class PaginatedList(PaginatedListBase): self.__nextUrl = None self.__nextParams = None - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data - ] + return self.makePage(headers, data) def __parseLinkHeader(self, headers): links = {} @@ -148,7 +167,4 @@ class PaginatedList(PaginatedListBase): params["per_page"] = self.__requester.per_page headers, data = self.__requester.requestJsonAndCheck("GET", self.__firstUrl, params, None) - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data - ] + return self.makePage(headers, data) diff --git a/github/Permissions.py b/github/Permissions.py index 8b9f3b39..3a346d76 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -30,6 +30,11 @@ class Permissions(github.GithubObject.NonCompletableGithubObject): """ This class represents Permissionss as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def admin(self): diff --git a/github/Plan.py b/github/Plan.py index 1daefc7c..638369b3 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -30,6 +30,11 @@ class Plan(github.GithubObject.NonCompletableGithubObject): """ This class represents Plans as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def collaborators(self): diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index f9bae790..7151b21f 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -31,6 +31,11 @@ class PullRequestMergeStatus(github.GithubObject.NonCompletableGithubObject): """ This class represents PullRequestMergeStatuss. The reference can be found here http://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def merged(self): diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 99778645..4a05fecc 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -33,6 +33,11 @@ class PullRequestPart(github.GithubObject.NonCompletableGithubObject): """ This class represents PullRequestParts as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def label(self): diff --git a/github/Tag.py b/github/Tag.py index 5a42f637..0b185f11 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -33,6 +33,11 @@ class Tag(github.GithubObject.NonCompletableGithubObject): """ This class represents Tags. The reference can be found here http://developer.github.com/v3/git/tags/ """ + def __init__(self, requester, attributes, completed): + ''' + Adapte for __init__ change, remove later + ''' + github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def commit(self): From b12c4b38c55ad9649541668950a01e6b3940a1bc Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:05:41 +0800 Subject: [PATCH 04/59] Update Tag.py --- github/PaginatedList.py | 26 +++++++++----------------- github/Tag.py | 5 ----- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/github/PaginatedList.py b/github/PaginatedList.py index effdb839..cad474de 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -118,23 +118,15 @@ class PaginatedList(PaginatedListBase): ''' Adapte for diffrent __init__ signature in refactoring, remove when done ''' - try: - if not inspect.isclass(self.__contentClass): - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data] - elif issubclass(self.__contentClass, github.GithubObject.NonCompletableGithubObject): - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data] - else: - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data] - except TypeError: # fix for some testcases, passed lambda in - print "WTF????????????????" - print self.__contentClass - raise + try: # Try use old __init__ signature + return [ + self.__contentClass(self.__requester, element, completed=False) + for element in data] + except TypeError: # must be new + return [ + self.__contentClass(self.__requester, headers, element, completed=False) + for element in data] + def _fetchNextPage(self): headers, data = self.__requester.requestJsonAndCheck("GET", self.__nextUrl, self.__nextParams, None) diff --git a/github/Tag.py b/github/Tag.py index 0b185f11..5a42f637 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -33,11 +33,6 @@ class Tag(github.GithubObject.NonCompletableGithubObject): """ This class represents Tags. The reference can be found here http://developer.github.com/v3/git/tags/ """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def commit(self): From 9f6562cb625d30b08b053da44a059ace70ed366e Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:07:23 +0800 Subject: [PATCH 05/59] Update CommitStatus.py --- github/Commit.py | 2 +- github/CommitStatus.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/Commit.py b/github/Commit.py index de9da2d1..1b9c6955 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -158,7 +158,7 @@ class Commit(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.CommitStatus.CommitStatus(self._requester, data, completed=True) + return github.CommitStatus.CommitStatus(self._requester, headers, data, completed=True) def get_comments(self): """ diff --git a/github/CommitStatus.py b/github/CommitStatus.py index b870cd30..122c55c4 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -32,11 +32,6 @@ class CommitStatus(github.GithubObject.NonCompletableGithubObject): """ This class represents CommitStatuss as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def created_at(self): From e8e8d174fb65249dd6aa41d3ec7993223dc83af4 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:08:48 +0800 Subject: [PATCH 06/59] Update Event.py --- github/Event.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/github/Event.py b/github/Event.py index bf185c4a..60e7c863 100644 --- a/github/Event.py +++ b/github/Event.py @@ -35,11 +35,6 @@ class Event(github.GithubObject.NonCompletableGithubObject): """ This class represents Events. The reference can be found here http://developer.github.com/v3/activity/events/ """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def actor(self): From 6943f6da7f84b05b8eae4555dbc598df2fe5ec01 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:10:32 +0800 Subject: [PATCH 07/59] Update Branch.py --- github/Branch.py | 5 ----- github/Repository.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/Branch.py b/github/Branch.py index 6e9f094f..11f074d5 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -33,11 +33,6 @@ class Branch(github.GithubObject.NonCompletableGithubObject): """ This class represents Branchs. The reference can be found here http://developer.github.com/v3/repos/#list-branches """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def commit(self): diff --git a/github/Repository.py b/github/Repository.py index fd3afbce..1fc28f2e 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -769,7 +769,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Branch.Branch(self._requester, data, completed=True) + return github.Branch.Branch(self._requester, headers, data, completed=True) def get_branches(self): """ From bb56857b4d5e9d85f26815a3da4c69f6bc718fbd Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:15:25 +0800 Subject: [PATCH 08/59] Update File.py --- github/Commit.py | 2 +- github/Comparison.py | 2 +- github/File.py | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/github/Commit.py b/github/Commit.py index 1b9c6955..132fff20 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -211,7 +211,7 @@ class Commit(github.GithubObject.CompletableGithubObject): if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] self._files = None if attributes["files"] is None else [ - github.File.File(self._requester, element, completed=False) + github.File.File(self._requester, self._headers, element, completed=False) for element in attributes["files"] ] if "parents" in attributes: # pragma no branch diff --git a/github/Comparison.py b/github/Comparison.py index a67cb5ae..eb9eadd8 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -166,7 +166,7 @@ class Comparison(github.GithubObject.CompletableGithubObject): if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] self._files = None if attributes["files"] is None else [ - github.File.File(self._requester, element, completed=False) + github.File.File(self._requester, self._headers, element, completed=False) for element in attributes["files"] ] if "html_url" in attributes: # pragma no branch diff --git a/github/File.py b/github/File.py index e126bac0..538fde6b 100644 --- a/github/File.py +++ b/github/File.py @@ -30,11 +30,6 @@ class File(github.GithubObject.NonCompletableGithubObject): """ This class represents Files as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): From c2dd9452eabc70bf88fc4769e48df63c0de8ce8a Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:18:29 +0800 Subject: [PATCH 09/59] Update Gist.py --- github/Gist.py | 2 +- github/GistFile.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/Gist.py b/github/Gist.py index 66866a81..ed6aa37f 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -317,7 +317,7 @@ class Gist(github.GithubObject.CompletableGithubObject): if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"].itervalues()), attributes["files"] self._files = None if attributes["files"] is None else dict( - (key, github.GistFile.GistFile(self._requester, element, completed=False)) + (key, github.GistFile.GistFile(self._requester, self._headers, element, completed=False)) for key, element in attributes["files"].iteritems() ) if "fork_of" in attributes: # pragma no branch diff --git a/github/GistFile.py b/github/GistFile.py index 458fd87e..a153c7ba 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -30,11 +30,6 @@ class GistFile(github.GithubObject.NonCompletableGithubObject): """ This class represents GistFiles as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): From 4f1e05200d35e951fb52730c3d783c2942836695 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:21:49 +0800 Subject: [PATCH 10/59] Update GitAuthor.py --- github/GitAuthor.py | 5 ----- github/GitCommit.py | 4 ++-- github/GitTag.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/github/GitAuthor.py b/github/GitAuthor.py index 71d3b3c1..dd409dea 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -30,11 +30,6 @@ class GitAuthor(github.GithubObject.NonCompletableGithubObject): """ This class represents GitAuthors as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def date(self): diff --git a/github/GitCommit.py b/github/GitCommit.py index c87ca26b..32af246a 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -106,10 +106,10 @@ class GitCommit(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "author" in attributes: # pragma no branch assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] - self._author = None if attributes["author"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["author"], completed=False) + self._author = None if attributes["author"] is None else github.GitAuthor.GitAuthor(self._requester, self._headers, attributes["author"], completed=False) if "committer" in attributes: # pragma no branch assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] - self._committer = None if attributes["committer"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["committer"], completed=False) + self._committer = None if attributes["committer"] is None else github.GitAuthor.GitAuthor(self._requester, self._headers, attributes["committer"], completed=False) if "message" in attributes: # pragma no branch assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] self._message = attributes["message"] diff --git a/github/GitTag.py b/github/GitTag.py index 980328a0..0a745d22 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -105,7 +105,19 @@ class GitTag(github.GithubObject.CompletableGithubObject): self._tag = attributes["tag"] if "tagger" in attributes: # pragma no branch assert attributes["tagger"] is None or isinstance(attributes["tagger"], dict), attributes["tagger"] - self._tagger = None if attributes["tagger"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["tagger"], completed=False) + self._tagger = None if attributes["tagger"] is None else github.GitAuthor.GitAuthor(self._requester, self._headers, attributes["tagger"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + + + + + + + + + + From 0879cbb6ff5f349bc8f867dace06801cf8f04136 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:23:21 +0800 Subject: [PATCH 11/59] Update GitignoreTemplate.py --- github/GitignoreTemplate.py | 5 ----- github/MainClass.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/GitignoreTemplate.py b/github/GitignoreTemplate.py index 82b6def9..a1b96d7c 100644 --- a/github/GitignoreTemplate.py +++ b/github/GitignoreTemplate.py @@ -29,11 +29,6 @@ class GitignoreTemplate(github.GithubObject.NonCompletableGithubObject): """ This class represents GitignoreTemplates as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def source(self): diff --git a/github/MainClass.py b/github/MainClass.py index ff180ef4..4fbe3645 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -308,7 +308,7 @@ class Github(object): None, None ) - return GitignoreTemplate.GitignoreTemplate(self.__requester, attributes, completed=True) + return GitignoreTemplate.GitignoreTemplate(self.__requester, headers, attributes, completed=True) def create_from_raw_data(self, klass, raw_data): """ From 274ab70f874098d1a0385e636748f0651b739e62 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:26:08 +0800 Subject: [PATCH 12/59] Update GitObject.py --- github/GitObject.py | 5 ----- github/GitRef.py | 2 +- github/GitTag.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/github/GitObject.py b/github/GitObject.py index 2d18d850..2d29b437 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -30,11 +30,6 @@ class GitObject(github.GithubObject.NonCompletableGithubObject): """ This class represents GitObjects as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def sha(self): diff --git a/github/GitRef.py b/github/GitRef.py index 44d177b8..9ff4f30f 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -99,7 +99,7 @@ class GitRef(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "object" in attributes: # pragma no branch assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] - self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, attributes["object"], completed=False) + self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, self._headers, attributes["object"], completed=False) if "ref" in attributes: # pragma no branch assert attributes["ref"] is None or isinstance(attributes["ref"], (str, unicode)), attributes["ref"] self._ref = attributes["ref"] diff --git a/github/GitTag.py b/github/GitTag.py index 0a745d22..58a34598 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -96,7 +96,7 @@ class GitTag(github.GithubObject.CompletableGithubObject): self._message = attributes["message"] if "object" in attributes: # pragma no branch assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] - self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, attributes["object"], completed=False) + self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, self._headers, attributes["object"], 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"] From 02435f3a9f5f321f5ff3d5c1f4bcb9a10fc5e290 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:30:39 +0800 Subject: [PATCH 13/59] Update GitTree.py --- github/GitTree.py | 7 ++++++- github/GitTreeElement.py | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/github/GitTree.py b/github/GitTree.py index 38c696b8..f999de89 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -73,9 +73,14 @@ class GitTree(github.GithubObject.CompletableGithubObject): if "tree" in attributes: # pragma no branch assert attributes["tree"] is None or all(isinstance(element, dict) for element in attributes["tree"]), attributes["tree"] self._tree = None if attributes["tree"] is None else [ - github.GitTreeElement.GitTreeElement(self._requester, element, completed=False) + github.GitTreeElement.GitTreeElement(self._requester, self._headers, element, completed=False) for element in attributes["tree"] ] if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + + + diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index f58b57b3..bf361be0 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -30,11 +30,6 @@ class GitTreeElement(github.GithubObject.NonCompletableGithubObject): """ This class represents GitTreeElements as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def mode(self): From ac1585ee13f13cfa20fd79a78c4643de815607fd Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 13:59:08 +0800 Subject: [PATCH 14/59] Update HookDescription.py. --- github/HookDescription.py | 5 ----- github/MainClass.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/HookDescription.py b/github/HookDescription.py index 3a665159..766cbfc7 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -30,11 +30,6 @@ class HookDescription(github.GithubObject.NonCompletableGithubObject): """ This class represents HookDescriptions as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def events(self): diff --git a/github/MainClass.py b/github/MainClass.py index 4fbe3645..c113e565 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -281,7 +281,7 @@ class Github(object): None, None ) - return [HookDescription.HookDescription(self.__requester, attributes, completed=True) for attributes in data] + return [HookDescription.HookDescription(self.__requester, headers, attributes, completed=True) for attributes in data] def get_gitignore_templates(self): """ From d6170e36de261f8107cdc40e1e6e3c91bac0eb3d Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:03:57 +0800 Subject: [PATCH 15/59] Update IssuePullRequest.py --- github/Issue.py | 2 +- github/IssuePullRequest.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index fd62dccf..502263de 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -412,7 +412,7 @@ class Issue(github.GithubObject.CompletableGithubObject): self._number = attributes["number"] if "pull_request" in attributes: # pragma no branch assert attributes["pull_request"] is None or isinstance(attributes["pull_request"], dict), attributes["pull_request"] - self._pull_request = None if attributes["pull_request"] is None else github.IssuePullRequest.IssuePullRequest(self._requester, attributes["pull_request"], completed=False) + 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) diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index 075b61ce..cdc1b44b 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -30,11 +30,6 @@ class IssuePullRequest(github.GithubObject.NonCompletableGithubObject): """ This class represents IssuePullRequests as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def diff_url(self): From 12387505e2fbf25ceae63f169b13d57d86b80282 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:05:10 +0800 Subject: [PATCH 16/59] Update Notification.py --- github/Notification.py | 5 ++++- github/NotificationSubject.py | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/github/Notification.py b/github/Notification.py index 7e8f0a2b..f6f89fa5 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -107,7 +107,7 @@ class Notification(github.GithubObject.CompletableGithubObject): self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, 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, attributes["subject"], completed=False) + self._subject = None if attributes["subject"] is None else github.NotificationSubject.NotificationSubject(self._requester, self._headers, attributes["subject"], completed=False) if "reason" in attributes: # pragma no branch assert attributes["reason"] is None or isinstance(attributes["reason"], (str, unicode)), attributes["reason"] self._reason = attributes["reason"] @@ -120,3 +120,6 @@ class Notification(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + diff --git a/github/NotificationSubject.py b/github/NotificationSubject.py index 4188e059..d32977ea 100644 --- a/github/NotificationSubject.py +++ b/github/NotificationSubject.py @@ -28,11 +28,6 @@ class NotificationSubject(github.GithubObject.NonCompletableGithubObject): """ This class represents Subjects of Notifications as returned for example by http://developer.github.com/v3/activity/notifications/#list-your-notifications """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def title(self): From 6e11aa9cf041be25691971476bc474facb1bd1f1 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:07:10 +0800 Subject: [PATCH 17/59] Update Permissions.py --- github/Permissions.py | 5 ----- github/Repository.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/Permissions.py b/github/Permissions.py index 3a346d76..8b9f3b39 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -30,11 +30,6 @@ class Permissions(github.GithubObject.NonCompletableGithubObject): """ This class represents Permissionss as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def admin(self): diff --git a/github/Repository.py b/github/Repository.py index 1fc28f2e..8e3fb440 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1719,7 +1719,7 @@ class Repository(github.GithubObject.CompletableGithubObject): self._parent = None if attributes["parent"] is None else Repository(self._requester, 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, attributes["permissions"], completed=False) + self._permissions = None if attributes["permissions"] is None else github.Permissions.Permissions(self._requester, self._headers, attributes["permissions"], completed=False) if "private" in attributes: # pragma no branch assert attributes["private"] is None or isinstance(attributes["private"], bool), attributes["private"] self._private = attributes["private"] From dcb6874745b2e0466017f94be745ba35b72a3748 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:09:11 +0800 Subject: [PATCH 18/59] Fix CommitStats.py --- github/Commit.py | 2 +- github/CommitStats.py | 5 ----- github/GistHistoryState.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/github/Commit.py b/github/Commit.py index 132fff20..322797fe 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -225,7 +225,7 @@ class Commit(github.GithubObject.CompletableGithubObject): self._sha = attributes["sha"] if "stats" in attributes: # pragma no branch assert attributes["stats"] is None or isinstance(attributes["stats"], dict), attributes["stats"] - self._stats = None if attributes["stats"] is None else github.CommitStats.CommitStats(self._requester, attributes["stats"], completed=False) + self._stats = None if attributes["stats"] is None else github.CommitStats.CommitStats(self._requester, self._headers, attributes["stats"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] diff --git a/github/CommitStats.py b/github/CommitStats.py index ce367f48..1be6a1d4 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -30,11 +30,6 @@ class CommitStats(github.GithubObject.NonCompletableGithubObject): """ This class represents CommitStatss as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 75f78535..2f095558 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -84,7 +84,7 @@ class GistHistoryState(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "change_status" in attributes: # pragma no branch assert attributes["change_status"] is None or isinstance(attributes["change_status"], dict), attributes["change_status"] - self._change_status = None if attributes["change_status"] is None else github.CommitStats.CommitStats(self._requester, attributes["change_status"], completed=False) + self._change_status = None if attributes["change_status"] is None else github.CommitStats.CommitStats(self._requester, self._headers, attributes["change_status"], completed=False) if "committed_at" in attributes: # pragma no branch assert attributes["committed_at"] is None or isinstance(attributes["committed_at"], (str, unicode)), attributes["committed_at"] self._committed_at = self._parseDatetime(attributes["committed_at"]) From deb0514b5e7364b307a611797681da8ddf6db5c1 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:10:37 +0800 Subject: [PATCH 19/59] Update Hook.py --- github/Hook.py | 3 ++- github/HookResponse.py | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/github/Hook.py b/github/Hook.py index e3a955d3..4366b559 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -195,7 +195,7 @@ class Hook(github.GithubObject.CompletableGithubObject): self._id = attributes["id"] if "last_response" in attributes: # pragma no branch assert attributes["last_response"] is None or isinstance(attributes["last_response"], dict), attributes["last_response"] - self._last_response = None if attributes["last_response"] is None else github.HookResponse.HookResponse(self._requester, attributes["last_response"], completed=False) + self._last_response = None if attributes["last_response"] is None else github.HookResponse.HookResponse(self._requester, self._headers, attributes["last_response"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] @@ -205,3 +205,4 @@ class Hook(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + diff --git a/github/HookResponse.py b/github/HookResponse.py index 8b3b0183..87dc0ac0 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -30,11 +30,6 @@ class HookResponse(github.GithubObject.NonCompletableGithubObject): """ This class represents HookResponses as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def code(self): From c7aeaddfa8897ed9a23764bbb4beda29403ab413 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:13:14 +0800 Subject: [PATCH 20/59] Fix PullRequestMergeStatus.py --- github/PullRequest.py | 2 +- github/PullRequestMergeStatus.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/github/PullRequest.py b/github/PullRequest.py index 0adad292..ba02376e 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -462,7 +462,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.PullRequestMergeStatus.PullRequestMergeStatus(self._requester, data, completed=True) + return github.PullRequestMergeStatus.PullRequestMergeStatus(self._requester, headers, data, completed=True) def _initAttributes(self): self._additions = github.GithubObject.NotSet diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index 7151b21f..f9bae790 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -31,11 +31,6 @@ class PullRequestMergeStatus(github.GithubObject.NonCompletableGithubObject): """ This class represents PullRequestMergeStatuss. The reference can be found here http://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def merged(self): From b2c4519c06cf541ae327d80b0b1361e2698e23ae Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:15:09 +0800 Subject: [PATCH 21/59] Update PulllRequestPart.py --- github/PullRequest.py | 4 ++-- github/PullRequestPart.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/github/PullRequest.py b/github/PullRequest.py index ba02376e..a30fa2f8 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -502,7 +502,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] - self._base = None if attributes["base"] is None else github.PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False) + self._base = None if attributes["base"] is None else github.PullRequestPart.PullRequestPart(self._requester, self._headers, attributes["base"], completed=False) if "body" in attributes: # pragma no branch assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] self._body = attributes["body"] @@ -529,7 +529,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._diff_url = attributes["diff_url"] if "head" in attributes: # pragma no branch assert attributes["head"] is None or isinstance(attributes["head"], dict), attributes["head"] - self._head = None if attributes["head"] is None else github.PullRequestPart.PullRequestPart(self._requester, attributes["head"], completed=False) + self._head = None if attributes["head"] is None else github.PullRequestPart.PullRequestPart(self._requester, self._headers, attributes["head"], completed=False) if "html_url" in attributes: # pragma no branch assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 4a05fecc..99778645 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -33,11 +33,6 @@ class PullRequestPart(github.GithubObject.NonCompletableGithubObject): """ This class represents PullRequestParts as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def label(self): From 4a1a1d406896ebd96315fcf9092ab68dfb7a7194 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:19:31 +0800 Subject: [PATCH 22/59] Update Plan.py --- github/AuthenticatedUser.py | 2 +- github/NamedUser.py | 2 +- github/Organization.py | 2 +- github/Plan.py | 5 ----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index a92a7813..5c4c4866 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -1061,7 +1061,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, self._headers, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/NamedUser.py b/github/NamedUser.py index a8016a15..bb99030a 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -541,7 +541,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, self._headers, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/Organization.py b/github/Organization.py index efe9cef0..bf341419 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -655,7 +655,7 @@ class Organization(github.GithubObject.CompletableGithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, self._headers, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/Plan.py b/github/Plan.py index 638369b3..1daefc7c 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -30,11 +30,6 @@ class Plan(github.GithubObject.NonCompletableGithubObject): """ This class represents Plans as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - ''' - Adapte for __init__ change, remove later - ''' - github.GithubObject.NonCompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def collaborators(self): From a1b65636df9408d93b115a3533a091e3e9cc68c4 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:25:07 +0800 Subject: [PATCH 23/59] Clean up. NonCompletableGithubObject refactoring resolved. --- github/GithubObject.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/github/GithubObject.py b/github/GithubObject.py index 4289a445..e4060dff 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -80,11 +80,6 @@ class GithubObject(object): class NonCompletableGithubObject(GithubObject): -# def __init__(self, requester, attributes, completed): -# ''' -# Adapte for __init__ change, remove later -# ''' -# GithubObject.__init__(self, requester, {}, attributes, completed) def _completeIfNeeded(self): pass From ca6189c3c94fac963811342ce9f77104d0b5774b Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 14:49:20 +0800 Subject: [PATCH 24/59] Change CompletableGithubObject.__init__ without breaking build. --- github/AuthenticatedUser.py | 3 +++ github/Authorization.py | 3 +++ github/AuthorizationApplication.py | 3 +++ github/Commit.py | 3 +++ github/CommitComment.py | 3 +++ github/Comparison.py | 3 +++ github/ContentFile.py | 3 +++ github/Download.py | 3 +++ github/Gist.py | 3 +++ github/GistComment.py | 3 +++ github/GistHistoryState.py | 3 +++ github/GitBlob.py | 3 +++ github/GitCommit.py | 3 +++ github/GitRef.py | 3 +++ github/GitTag.py | 3 +++ github/GitTree.py | 3 +++ github/GithubObject.py | 5 +++-- github/Hook.py | 3 +++ github/Issue.py | 3 +++ github/IssueComment.py | 3 +++ github/IssueEvent.py | 3 +++ github/Label.py | 3 +++ github/Milestone.py | 3 +++ github/NamedUser.py | 3 +++ github/Notification.py | 3 +++ github/Organization.py | 3 +++ github/PullRequest.py | 3 +++ github/PullRequestComment.py | 3 +++ github/Repository.py | 3 +++ github/RepositoryKey.py | 3 ++- github/Team.py | 3 +++ github/UserKey.py | 3 +++ 32 files changed, 95 insertions(+), 3 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 5c4c4866..02467ebb 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -44,6 +44,9 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): """ This class represents AuthenticatedUsers as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/Authorization.py b/github/Authorization.py index 14cc1350..ec9d2241 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -32,6 +32,9 @@ class Authorization(github.GithubObject.CompletableGithubObject): """ This class represents Authorizations as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def app(self): diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index 392ec78c..af9c9b7c 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -30,6 +30,9 @@ class AuthorizationApplication(github.GithubObject.CompletableGithubObject): """ This class represents AuthorizationApplications as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def name(self): diff --git a/github/Commit.py b/github/Commit.py index 322797fe..ada886d1 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -39,6 +39,9 @@ class Commit(github.GithubObject.CompletableGithubObject): """ This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def author(self): diff --git a/github/CommitComment.py b/github/CommitComment.py index 30f1df3a..166454ae 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -32,6 +32,9 @@ class CommitComment(github.GithubObject.CompletableGithubObject): """ This class represents CommitComments as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/Comparison.py b/github/Comparison.py index eb9eadd8..a131d1b6 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -33,6 +33,9 @@ class Comparison(github.GithubObject.CompletableGithubObject): """ This class represents Comparisons as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def ahead_by(self): diff --git a/github/ContentFile.py b/github/ContentFile.py index fda1d3d6..f38591f8 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -30,6 +30,9 @@ class ContentFile(github.GithubObject.CompletableGithubObject): """ This class represents ContentFiles as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): diff --git a/github/Download.py b/github/Download.py index 7555a8c3..47db03a8 100644 --- a/github/Download.py +++ b/github/Download.py @@ -30,6 +30,9 @@ class Download(github.GithubObject.CompletableGithubObject): """ This class represents Downloads as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def accesskeyid(self): diff --git a/github/Gist.py b/github/Gist.py index ed6aa37f..5453179f 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -37,6 +37,9 @@ class Gist(github.GithubObject.CompletableGithubObject): """ This class represents Gists as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def comments(self): diff --git a/github/GistComment.py b/github/GistComment.py index 2bb28abd..d228476f 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -32,6 +32,9 @@ class GistComment(github.GithubObject.CompletableGithubObject): """ This class represents GistComments as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 2f095558..34288f1d 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -33,6 +33,9 @@ class GistHistoryState(github.GithubObject.CompletableGithubObject): """ This class represents GistHistoryStates as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def change_status(self): diff --git a/github/GitBlob.py b/github/GitBlob.py index ffb12f98..e4adf50b 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -30,6 +30,9 @@ class GitBlob(github.GithubObject.CompletableGithubObject): """ This class represents GitBlobs as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): diff --git a/github/GitCommit.py b/github/GitCommit.py index 32af246a..488c82d0 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -33,6 +33,9 @@ class GitCommit(github.GithubObject.CompletableGithubObject): """ This class represents GitCommits as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def author(self): diff --git a/github/GitRef.py b/github/GitRef.py index 9ff4f30f..fd81e371 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -32,6 +32,9 @@ class GitRef(github.GithubObject.CompletableGithubObject): """ This class represents GitRefs as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def object(self): diff --git a/github/GitTag.py b/github/GitTag.py index 58a34598..186f8928 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -33,6 +33,9 @@ class GitTag(github.GithubObject.CompletableGithubObject): """ This class represents GitTags as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def message(self): diff --git a/github/GitTree.py b/github/GitTree.py index f999de89..741180f2 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -32,6 +32,9 @@ class GitTree(github.GithubObject.CompletableGithubObject): """ This class represents GitTrees as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def sha(self): diff --git a/github/GithubObject.py b/github/GithubObject.py index e4060dff..077cc5c2 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -85,9 +85,9 @@ class NonCompletableGithubObject(GithubObject): class CompletableGithubObject(GithubObject): - def __init__(self, requester, attributes, completed): + def __init__(self, requester, headers, attributes, completed): # Adapte for __init__ change, remove later - GithubObject.__init__(self, requester, {}, attributes, completed) + GithubObject.__init__(self, requester, headers, attributes, completed) self.__completed = completed def _completeIfNotSet(self, value): @@ -105,5 +105,6 @@ class CompletableGithubObject(GithubObject): None, None ) + self._headers = headers self._storeAndUseAttributes(data) self.__completed = True diff --git a/github/Hook.py b/github/Hook.py index 4366b559..965cc2ae 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -32,6 +32,9 @@ class Hook(github.GithubObject.CompletableGithubObject): """ This class represents Hooks as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def active(self): diff --git a/github/Issue.py b/github/Issue.py index 502263de..6c4c9161 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -41,6 +41,9 @@ class Issue(github.GithubObject.CompletableGithubObject): """ This class represents Issues as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def assignee(self): diff --git a/github/IssueComment.py b/github/IssueComment.py index 5e9e5099..d39470ab 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -33,6 +33,9 @@ class IssueComment(github.GithubObject.CompletableGithubObject): """ This class represents IssueComments as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 431ce2ad..2a5677af 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -33,6 +33,9 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): """ This class represents IssueEvents as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def actor(self): diff --git a/github/Label.py b/github/Label.py index e2d42335..e09082ff 100644 --- a/github/Label.py +++ b/github/Label.py @@ -33,6 +33,9 @@ class Label(github.GithubObject.CompletableGithubObject): """ This class represents Labels. The reference can be found here http://developer.github.com/v3/issues/labels/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def color(self): diff --git a/github/Milestone.py b/github/Milestone.py index 9611d7b7..2650d24b 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -37,6 +37,9 @@ class Milestone(github.GithubObject.CompletableGithubObject): """ This class represents Milestones. The reference can be found here http://developer.github.com/v3/issues/milestones/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def closed_issues(self): diff --git a/github/NamedUser.py b/github/NamedUser.py index bb99030a..b1e619af 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -39,6 +39,9 @@ class NamedUser(github.GithubObject.CompletableGithubObject): """ This class represents NamedUsers as returned for example by http://developer.github.com/v3/todo """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/Notification.py b/github/Notification.py index f6f89fa5..433cfcd3 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -33,6 +33,9 @@ class Notification(github.GithubObject.CompletableGithubObject): """ This class represents Notifications. The reference can be found here http://developer.github.com/v3/activity/notifications/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): diff --git a/github/Organization.py b/github/Organization.py index bf341419..16db918d 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -41,6 +41,9 @@ class Organization(github.GithubObject.CompletableGithubObject): """ This class represents Organizations. The reference can be found here http://developer.github.com/v3/orgs/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/PullRequest.py b/github/PullRequest.py index a30fa2f8..32c213c5 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -41,6 +41,9 @@ class PullRequest(github.GithubObject.CompletableGithubObject): """ This class represents PullRequests. The reference can be found here http://developer.github.com/v3/pulls/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index c8f0ef6f..31be092b 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -34,6 +34,9 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject): """ This class represents PullRequestComments. The reference can be found here http://developer.github.com/v3/pulls/comments/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/Repository.py b/github/Repository.py index 8e3fb440..50822782 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -65,6 +65,9 @@ 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): diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 750541b2..788ac6e3 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -34,7 +34,8 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject): """ def __init__(self, requester, attributes, completed, repoUrl): - github.GithubObject.CompletableGithubObject.__init__(self, requester, attributes, completed) + ##############NOTE: this one should not be removed but modified + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) self.__repoUrl = repoUrl @property diff --git a/github/Team.py b/github/Team.py index b6d681d6..0637d057 100644 --- a/github/Team.py +++ b/github/Team.py @@ -35,6 +35,9 @@ class Team(github.GithubObject.CompletableGithubObject): """ This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): diff --git a/github/UserKey.py b/github/UserKey.py index 222cd1a5..392a0b64 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -31,6 +31,9 @@ class UserKey(github.GithubObject.CompletableGithubObject): """ This class represents UserKeys. The reference can be found here http://developer.github.com/v3/users/keys/ """ + def __init__(self, requester, attributes, completed): + # Adapte for __init__ change, remove later + github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): From 2f31828502c95fef62970db7d4ca49fa8b4b8e0d Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:04:34 +0800 Subject: [PATCH 25/59] Update RepositoryKey.py --- github/PaginatedList.py | 18 +++++++++++++----- github/Repository.py | 6 +++--- github/RepositoryKey.py | 5 ++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/github/PaginatedList.py b/github/PaginatedList.py index cad474de..1911f098 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -118,14 +118,22 @@ class PaginatedList(PaginatedListBase): ''' Adapte for diffrent __init__ signature in refactoring, remove when done ''' - try: # Try use old __init__ signature + try: + try: # Try use old __init__ signature + return [ + self.__contentClass(self.__requester, element, completed=False) + for element in data] + except TypeError: # must be new + return [ + self.__contentClass(self.__requester, headers, element, completed=False) + for element in data] + except: + print "WTF???????????" + print self.__contentClass return [ self.__contentClass(self.__requester, element, completed=False) for element in data] - except TypeError: # must be new - return [ - self.__contentClass(self.__requester, headers, element, completed=False) - for element in data] + def _fetchNextPage(self): diff --git a/github/Repository.py b/github/Repository.py index 50822782..e8077b14 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -578,7 +578,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) + return github.RepositoryKey.RepositoryKey(self._requester, headers, data, completed=True, repoUrl=self._url) def create_label(self, name, color): """ @@ -1239,7 +1239,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) + return github.RepositoryKey.RepositoryKey(self._requester, headers, data, completed=True, repoUrl=self._url) def get_keys(self): """ @@ -1247,7 +1247,7 @@ class Repository(github.GithubObject.CompletableGithubObject): :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.RepositoryKey.RepositoryKey` """ return github.PaginatedList.PaginatedList( - lambda requester, data, completed: github.RepositoryKey.RepositoryKey(requester, data, completed, repoUrl=self._url), + lambda requester, headers, data, completed: github.RepositoryKey.RepositoryKey(requester, headers, data, completed, repoUrl=self._url), self._requester, self.url + "/keys", None diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 788ac6e3..9a7c7b28 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -33,9 +33,8 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject): This class represents RepositoryKeys. The reference can be found here http://developer.github.com/v3/repos/keys/ """ - def __init__(self, requester, attributes, completed, repoUrl): - ##############NOTE: this one should not be removed but modified - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) + def __init__(self, requester, headers, attributes, completed, repoUrl): + github.GithubObject.CompletableGithubObject.__init__(self, requester, headers, attributes, completed) self.__repoUrl = repoUrl @property From 28a49b94d87408592199ffa018e8c1b3bd9d2a77 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:06:21 +0800 Subject: [PATCH 26/59] Update AuthenticatedUser.py --- github/AuthenticatedUser.py | 3 --- github/MainClass.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 02467ebb..5c4c4866 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -44,9 +44,6 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): """ This class represents AuthenticatedUsers as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/MainClass.py b/github/MainClass.py index c113e565..8f821567 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -114,7 +114,7 @@ class Github(object): """ assert login is github.GithubObject.NotSet or isinstance(login, (str, unicode)), login if login is github.GithubObject.NotSet: - return AuthenticatedUser.AuthenticatedUser(self.__requester, {"url": "/user"}, completed=False) + return AuthenticatedUser.AuthenticatedUser(self.__requester, {}, {"url": "/user"}, completed=False) else: headers, data = self.__requester.requestJsonAndCheck( "GET", From 0e19d8e04e847aac690fcd5563c35aa0c1808a80 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:09:34 +0800 Subject: [PATCH 27/59] Update Authorization.py --- github/AuthenticatedUser.py | 4 ++-- github/Authorization.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 5c4c4866..7e4e337e 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -348,7 +348,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Authorization.Authorization(self._requester, data, completed=True) + return github.Authorization.Authorization(self._requester, headers, data, completed=True) def create_fork(self, repo): """ @@ -516,7 +516,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.Authorization.Authorization(self._requester, data, completed=True) + return github.Authorization.Authorization(self._requester, headers, data, completed=True) def get_authorizations(self): """ diff --git a/github/Authorization.py b/github/Authorization.py index ec9d2241..14cc1350 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -32,9 +32,6 @@ class Authorization(github.GithubObject.CompletableGithubObject): """ This class represents Authorizations as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def app(self): From 83c6495ec557898cd17a70be184c307558b4535c Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:10:54 +0800 Subject: [PATCH 28/59] Update AuthorizationApplication.py --- github/Authorization.py | 2 +- github/AuthorizationApplication.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/github/Authorization.py b/github/Authorization.py index 14cc1350..ef61ed84 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -165,7 +165,7 @@ class Authorization(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "app" in attributes: # pragma no branch assert attributes["app"] is None or isinstance(attributes["app"], dict), attributes["app"] - self._app = None if attributes["app"] is None else github.AuthorizationApplication.AuthorizationApplication(self._requester, attributes["app"], completed=False) + self._app = None if attributes["app"] is None else github.AuthorizationApplication.AuthorizationApplication(self._requester, self._headers, attributes["app"], completed=False) if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index af9c9b7c..392ec78c 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -30,9 +30,6 @@ class AuthorizationApplication(github.GithubObject.CompletableGithubObject): """ This class represents AuthorizationApplications as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def name(self): From ed32e78da1303962afaf8fa0d616a1828fdaa80b Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:26:05 +0800 Subject: [PATCH 29/59] Update Commit.py and GitCommit.py --- github/Branch.py | 2 +- github/Commit.py | 7 ++----- github/Comparison.py | 4 ++-- github/GitCommit.py | 5 +---- github/PaginatedList.py | 19 +++++++------------ github/Repository.py | 8 ++++---- github/Tag.py | 2 +- 7 files changed, 18 insertions(+), 29 deletions(-) diff --git a/github/Branch.py b/github/Branch.py index 11f074d5..5004f2f6 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -55,7 +55,7 @@ class Branch(github.GithubObject.NonCompletableGithubObject): def _useAttributes(self, attributes): if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, self._headers, attributes["commit"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] diff --git a/github/Commit.py b/github/Commit.py index ada886d1..91219da1 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -39,9 +39,6 @@ class Commit(github.GithubObject.CompletableGithubObject): """ This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def author(self): @@ -207,7 +204,7 @@ class Commit(github.GithubObject.CompletableGithubObject): self._author = None if attributes["author"] is None else github.NamedUser.NamedUser(self._requester, attributes["author"], completed=False) if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else github.GitCommit.GitCommit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.GitCommit.GitCommit(self._requester, self._headers, attributes["commit"], completed=False) if "committer" in attributes: # pragma no branch assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] self._committer = None if attributes["committer"] is None else github.NamedUser.NamedUser(self._requester, attributes["committer"], completed=False) @@ -220,7 +217,7 @@ class Commit(github.GithubObject.CompletableGithubObject): if "parents" in attributes: # pragma no branch assert attributes["parents"] is None or all(isinstance(element, dict) for element in attributes["parents"]), attributes["parents"] self._parents = None if attributes["parents"] is None else [ - Commit(self._requester, element, completed=False) + Commit(self._requester, self._headers, element, completed=False) for element in attributes["parents"] ] if "sha" in attributes: # pragma no branch diff --git a/github/Comparison.py b/github/Comparison.py index a131d1b6..3182b43d 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -153,14 +153,14 @@ class Comparison(github.GithubObject.CompletableGithubObject): self._ahead_by = attributes["ahead_by"] if "base_commit" in attributes: # pragma no branch assert attributes["base_commit"] is None or isinstance(attributes["base_commit"], dict), attributes["base_commit"] - self._base_commit = None if attributes["base_commit"] is None else github.Commit.Commit(self._requester, attributes["base_commit"], completed=False) + self._base_commit = None if attributes["base_commit"] is None else github.Commit.Commit(self._requester, self._headers, attributes["base_commit"], completed=False) if "behind_by" in attributes: # pragma no branch assert attributes["behind_by"] is None or isinstance(attributes["behind_by"], (int, long)), attributes["behind_by"] self._behind_by = attributes["behind_by"] if "commits" in attributes: # pragma no branch assert attributes["commits"] is None or all(isinstance(element, dict) for element in attributes["commits"]), attributes["commits"] self._commits = None if attributes["commits"] is None else [ - github.Commit.Commit(self._requester, element, completed=False) + github.Commit.Commit(self._requester, self._headers, element, completed=False) for element in attributes["commits"] ] if "diff_url" in attributes: # pragma no branch diff --git a/github/GitCommit.py b/github/GitCommit.py index 488c82d0..e9272bdc 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -33,9 +33,6 @@ class GitCommit(github.GithubObject.CompletableGithubObject): """ This class represents GitCommits as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def author(self): @@ -119,7 +116,7 @@ class GitCommit(github.GithubObject.CompletableGithubObject): if "parents" in attributes: # pragma no branch assert attributes["parents"] is None or all(isinstance(element, dict) for element in attributes["parents"]), attributes["parents"] self._parents = None if attributes["parents"] is None else [ - GitCommit(self._requester, element, completed=False) + GitCommit(self._requester, self._headers, element, completed=False) for element in attributes["parents"] ] if "sha" in attributes: # pragma no branch diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 1911f098..1ab477e1 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -118,21 +118,16 @@ class PaginatedList(PaginatedListBase): ''' Adapte for diffrent __init__ signature in refactoring, remove when done ''' - try: - try: # Try use old __init__ signature - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data] - except TypeError: # must be new - return [ - self.__contentClass(self.__requester, headers, element, completed=False) - for element in data] - except: - print "WTF???????????" - print self.__contentClass + + try: # Try use old __init__ signature return [ self.__contentClass(self.__requester, element, completed=False) for element in data] + except TypeError: # must be new + return [ + self.__contentClass(self.__requester, headers, element, completed=False) + for element in data] + diff --git a/github/Repository.py b/github/Repository.py index e8077b14..67c316d2 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -420,7 +420,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitCommit.GitCommit(self._requester, data, completed=True) + return github.GitCommit.GitCommit(self._requester, headers, data, completed=True) def create_git_ref(self, ref, sha): """ @@ -838,7 +838,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Commit.Commit(self._requester, data, completed=True) + return github.Commit.Commit(self._requester, headers, data, completed=True) def get_commits(self, sha=github.GithubObject.NotSet, path=github.GithubObject.NotSet): """ @@ -1014,7 +1014,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.GitCommit.GitCommit(self._requester, data, completed=True) + return github.GitCommit.GitCommit(self._requester, headers, data, completed=True) def get_git_ref(self, ref): """ @@ -1566,7 +1566,7 @@ class Repository(github.GithubObject.CompletableGithubObject): if data is None: return None else: - return github.Commit.Commit(self._requester, data, completed=True) + return github.Commit.Commit(self._requester, headers, data, completed=True) def remove_from_collaborators(self, collaborator): """ diff --git a/github/Tag.py b/github/Tag.py index 5a42f637..9300b607 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -71,7 +71,7 @@ class Tag(github.GithubObject.NonCompletableGithubObject): def _useAttributes(self, attributes): if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, self._headers, attributes["commit"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] From 3b2e19488fc6a5f51574d874e546173c1835d10b Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:28:00 +0800 Subject: [PATCH 30/59] Update CommitComment.py --- github/Commit.py | 2 +- github/CommitComment.py | 3 --- github/Repository.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/Commit.py b/github/Commit.py index 91219da1..0fba1935 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -132,7 +132,7 @@ class Commit(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.CommitComment.CommitComment(self._requester, data, completed=True) + return github.CommitComment.CommitComment(self._requester, headers, data, completed=True) def create_status(self, state, target_url=github.GithubObject.NotSet, description=github.GithubObject.NotSet): """ diff --git a/github/CommitComment.py b/github/CommitComment.py index 166454ae..30f1df3a 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -32,9 +32,6 @@ class CommitComment(github.GithubObject.CompletableGithubObject): """ This class represents CommitComments as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/Repository.py b/github/Repository.py index 67c316d2..8b8b5924 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -811,7 +811,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.CommitComment.CommitComment(self._requester, data, completed=True) + return github.CommitComment.CommitComment(self._requester, headers, data, completed=True) def get_comments(self): """ From ced048663ba392bfee2543cea5f5fbf875771c0e Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:29:13 +0800 Subject: [PATCH 31/59] Update Comparision.py --- github/Comparison.py | 3 --- github/Repository.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/github/Comparison.py b/github/Comparison.py index 3182b43d..a0a3d6de 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -33,9 +33,6 @@ class Comparison(github.GithubObject.CompletableGithubObject): """ This class represents Comparisons as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def ahead_by(self): diff --git a/github/Repository.py b/github/Repository.py index 8b8b5924..25fc4a14 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -338,7 +338,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Comparison.Comparison(self._requester, data, completed=True) + return github.Comparison.Comparison(self._requester, headers, data, completed=True) def create_download(self, name, size, description=github.GithubObject.NotSet, content_type=github.GithubObject.NotSet): """ From 0c13da45929dbc528a4f8f14f8ce54df15888660 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:31:45 +0800 Subject: [PATCH 32/59] Update ContentFile.py --- github/ContentFile.py | 3 --- github/Repository.py | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/github/ContentFile.py b/github/ContentFile.py index f38591f8..fda1d3d6 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -30,9 +30,6 @@ class ContentFile(github.GithubObject.CompletableGithubObject): """ This class represents ContentFiles as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): diff --git a/github/Repository.py b/github/Repository.py index 25fc4a14..2233b5d8 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -888,7 +888,7 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters, None ) - return github.ContentFile.ContentFile(self._requester, data, completed=True) + return github.ContentFile.ContentFile(self._requester, headers, data, completed=True) def get_dir_contents(self, path, ref=github.GithubObject.NotSet): """ @@ -919,7 +919,7 @@ class Repository(github.GithubObject.CompletableGithubObject): ) return [ - github.ContentFile.ContentFile(self._requester, attributes, completed=(attributes["type"] != "file")) # Lazy completion only makes sense for files. See discussion here: https://github.com/jacquev6/PyGithub/issues/140#issuecomment-13481130 + github.ContentFile.ContentFile(self._requester, headers, attributes, completed=(attributes["type"] != "file")) # Lazy completion only makes sense for files. See discussion here: https://github.com/jacquev6/PyGithub/issues/140#issuecomment-13481130 for attributes in data ] @@ -1428,7 +1428,7 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters, None ) - return github.ContentFile.ContentFile(self._requester, data, completed=True) + return github.ContentFile.ContentFile(self._requester, headers, data, completed=True) def get_stargazers(self): """ From c15cb6575b88b56b48fb21e66931ab2108c8b23c Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:33:25 +0800 Subject: [PATCH 33/59] Update Download.py --- github/Download.py | 3 --- github/Repository.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/Download.py b/github/Download.py index 47db03a8..7555a8c3 100644 --- a/github/Download.py +++ b/github/Download.py @@ -30,9 +30,6 @@ class Download(github.GithubObject.CompletableGithubObject): """ This class represents Downloads as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def accesskeyid(self): diff --git a/github/Repository.py b/github/Repository.py index 2233b5d8..023a43be 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -367,7 +367,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Download.Download(self._requester, data, completed=True) + return github.Download.Download(self._requester, headers, data, completed=True) def create_git_blob(self, content, encoding): """ @@ -948,7 +948,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Download.Download(self._requester, data, completed=True) + return github.Download.Download(self._requester, headers, data, completed=True) def get_downloads(self): """ From dc8173a5328cede580cae7e2bbf053ee98185d4e Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:39:34 +0800 Subject: [PATCH 34/59] Update Gist*.py --- github/AuthenticatedUser.py | 2 +- github/Gist.py | 13 +++++-------- github/GistComment.py | 3 --- github/GistHistoryState.py | 3 --- github/MainClass.py | 2 +- github/NamedUser.py | 2 +- 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 7e4e337e..93417fe4 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -388,7 +388,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Gist.Gist(self._requester, data, completed=True) + return github.Gist.Gist(self._requester, headers, data, completed=True) def create_key(self, title, key): """ diff --git a/github/Gist.py b/github/Gist.py index 5453179f..69498746 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -37,9 +37,6 @@ class Gist(github.GithubObject.CompletableGithubObject): """ This class represents Gists as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def comments(self): @@ -177,7 +174,7 @@ class Gist(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GistComment.GistComment(self._requester, data, completed=True) + return github.GistComment.GistComment(self._requester, headers, data, completed=True) def create_fork(self): """ @@ -190,7 +187,7 @@ class Gist(github.GithubObject.CompletableGithubObject): None, None ) - return Gist(self._requester, data, completed=True) + return Gist(self._requester, headers, data, completed=True) def delete(self): """ @@ -239,7 +236,7 @@ class Gist(github.GithubObject.CompletableGithubObject): None, None ) - return github.GistComment.GistComment(self._requester, data, completed=True) + return github.GistComment.GistComment(self._requester, headers, data, completed=True) def get_comments(self): """ @@ -325,7 +322,7 @@ class Gist(github.GithubObject.CompletableGithubObject): ) if "fork_of" in attributes: # pragma no branch assert attributes["fork_of"] is None or isinstance(attributes["fork_of"], dict), attributes["fork_of"] - self._fork_of = None if attributes["fork_of"] is None else Gist(self._requester, attributes["fork_of"], completed=False) + self._fork_of = None if attributes["fork_of"] is None else Gist(self._requester, self._headers, attributes["fork_of"], completed=False) if "forks" in attributes: # pragma no branch assert attributes["forks"] is None or all(isinstance(element, dict) for element in attributes["forks"]), attributes["forks"] self._forks = None if attributes["forks"] is None else [ @@ -341,7 +338,7 @@ class Gist(github.GithubObject.CompletableGithubObject): if "history" in attributes: # pragma no branch assert attributes["history"] is None or all(isinstance(element, dict) for element in attributes["history"]), attributes["history"] self._history = None if attributes["history"] is None else [ - github.GistHistoryState.GistHistoryState(self._requester, element, completed=False) + github.GistHistoryState.GistHistoryState(self._requester, self._headers, element, completed=False) for element in attributes["history"] ] if "html_url" in attributes: # pragma no branch diff --git a/github/GistComment.py b/github/GistComment.py index d228476f..2bb28abd 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -32,9 +32,6 @@ class GistComment(github.GithubObject.CompletableGithubObject): """ This class represents GistComments as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 34288f1d..2f095558 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -33,9 +33,6 @@ class GistHistoryState(github.GithubObject.CompletableGithubObject): """ This class represents GistHistoryStates as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def change_status(self): diff --git a/github/MainClass.py b/github/MainClass.py index 8f821567..182c8c2f 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -183,7 +183,7 @@ class Github(object): None, None ) - return github.Gist.Gist(self.__requester, data, completed=True) + return github.Gist.Gist(self.__requester, headers, data, completed=True) def get_gists(self): """ diff --git a/github/NamedUser.py b/github/NamedUser.py index b1e619af..3f979fca 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -274,7 +274,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Gist.Gist(self._requester, data, completed=True) + return github.Gist.Gist(self._requester, headers, data, completed=True) def get_events(self): """ From b43de50dc4f4a538e284645b4f83b597d008a8a2 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:48:08 +0800 Subject: [PATCH 35/59] Update GitBlob.py --- github/GitBlob.py | 3 --- github/Repository.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/GitBlob.py b/github/GitBlob.py index e4adf50b..ffb12f98 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -30,9 +30,6 @@ class GitBlob(github.GithubObject.CompletableGithubObject): """ This class represents GitBlobs as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def content(self): diff --git a/github/Repository.py b/github/Repository.py index 023a43be..d03ca49a 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -388,7 +388,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitBlob.GitBlob(self._requester, data, completed=True) + return github.GitBlob.GitBlob(self._requester, headers, data, completed=True) def create_git_commit(self, message, tree, parents, author=github.GithubObject.NotSet, committer=github.GithubObject.NotSet): """ @@ -999,7 +999,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.GitBlob.GitBlob(self._requester, data, completed=True) + return github.GitBlob.GitBlob(self._requester, headers, data, completed=True) def get_git_commit(self, sha): """ From 1dbc2dd38f5c31a8a48082daad4981c79d92f0b7 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:51:12 +0800 Subject: [PATCH 36/59] Update GitRef.py --- github/GitRef.py | 3 --- github/Repository.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/GitRef.py b/github/GitRef.py index fd81e371..9ff4f30f 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -32,9 +32,6 @@ class GitRef(github.GithubObject.CompletableGithubObject): """ This class represents GitRefs as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def object(self): diff --git a/github/Repository.py b/github/Repository.py index d03ca49a..290cd615 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -441,7 +441,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitRef.GitRef(self._requester, data, completed=True) + return github.GitRef.GitRef(self._requester, headers, data, completed=True) def create_git_tag(self, tag, message, object, type, tagger=github.GithubObject.NotSet): """ @@ -1032,7 +1032,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.GitRef.GitRef(self._requester, data, completed=True) + return github.GitRef.GitRef(self._requester, headers, data, completed=True) def get_git_refs(self): """ From c89bebc729b48477b0d8949d9179bb2e9a7c3bf8 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:52:57 +0800 Subject: [PATCH 37/59] Update GitTag.py --- github/GitTag.py | 3 --- github/Repository.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/GitTag.py b/github/GitTag.py index 186f8928..58a34598 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -33,9 +33,6 @@ class GitTag(github.GithubObject.CompletableGithubObject): """ This class represents GitTags as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def message(self): diff --git a/github/Repository.py b/github/Repository.py index 290cd615..c9757d5e 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -472,7 +472,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitTag.GitTag(self._requester, data, completed=True) + return github.GitTag.GitTag(self._requester, headers, data, completed=True) def create_git_tree(self, tree, base_tree=github.GithubObject.NotSet): """ @@ -1059,7 +1059,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.GitTag.GitTag(self._requester, data, completed=True) + return github.GitTag.GitTag(self._requester, headers, data, completed=True) def get_git_tree(self, sha, recursive=github.GithubObject.NotSet): """ From 038e35cb3d40f85b35b6fbe0807f9c761c474310 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:55:42 +0800 Subject: [PATCH 38/59] Update GitTree --- github/GitCommit.py | 14 +++++++++++++- github/GitTree.py | 3 --- github/Repository.py | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/github/GitCommit.py b/github/GitCommit.py index e9272bdc..ab012fba 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -124,7 +124,19 @@ class GitCommit(github.GithubObject.CompletableGithubObject): self._sha = attributes["sha"] if "tree" in attributes: # pragma no branch assert attributes["tree"] is None or isinstance(attributes["tree"], dict), attributes["tree"] - self._tree = None if attributes["tree"] is None else github.GitTree.GitTree(self._requester, attributes["tree"], completed=False) + self._tree = None if attributes["tree"] is None else github.GitTree.GitTree(self._requester, self._headers, attributes["tree"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + + + + + + + + + + diff --git a/github/GitTree.py b/github/GitTree.py index 741180f2..f999de89 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -32,9 +32,6 @@ class GitTree(github.GithubObject.CompletableGithubObject): """ This class represents GitTrees as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def sha(self): diff --git a/github/Repository.py b/github/Repository.py index c9757d5e..e733d891 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -494,7 +494,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, headers, data, completed=True) def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): """ @@ -1079,7 +1079,7 @@ class Repository(github.GithubObject.CompletableGithubObject): url_parameters, None ) - return github.GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, headers, data, completed=True) def get_hook(self, id): """ From 044a000d7647e9134c69378f760ff1a2bd141f4d Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:58:07 +0800 Subject: [PATCH 39/59] Update Hook.py --- github/Hook.py | 3 --- github/Repository.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/Hook.py b/github/Hook.py index 965cc2ae..4366b559 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -32,9 +32,6 @@ class Hook(github.GithubObject.CompletableGithubObject): """ This class represents Hooks as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def active(self): diff --git a/github/Repository.py b/github/Repository.py index e733d891..a58a5990 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -523,7 +523,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Hook.Hook(self._requester, data, completed=True) + return github.Hook.Hook(self._requester, headers, data, completed=True) def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet): """ @@ -1094,7 +1094,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Hook.Hook(self._requester, data, completed=True) + return github.Hook.Hook(self._requester, headers, data, completed=True) def get_hooks(self): """ From 49a69c9425789cfb21c49888a144b123ae564cf3 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:08:54 +0800 Subject: [PATCH 40/59] Update Issue.py --- github/Issue.py | 3 --- github/IssueEvent.py | 14 +++++++++++++- github/Repository.py | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index 6c4c9161..502263de 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -41,9 +41,6 @@ class Issue(github.GithubObject.CompletableGithubObject): """ This class represents Issues as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def assignee(self): diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 2a5677af..aa64f355 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -120,7 +120,19 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): self._id = attributes["id"] if "issue" in attributes: # pragma no branch assert attributes["issue"] is None or isinstance(attributes["issue"], dict), attributes["issue"] - self._issue = None if attributes["issue"] is None else github.Issue.Issue(self._requester, attributes["issue"], completed=False) + self._issue = None if attributes["issue"] is None else github.Issue.Issue(self._requester, self._headers, attributes["issue"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] + + + + + + + + + + + + diff --git a/github/Repository.py b/github/Repository.py index a58a5990..c364b058 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -557,7 +557,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Issue.Issue(self._requester, data, completed=True) + return github.Issue.Issue(self._requester, headers, data, completed=True) def create_key(self, title, key): """ @@ -1121,7 +1121,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Issue.Issue(self._requester, data, completed=True) + return github.Issue.Issue(self._requester, headers, data, completed=True) def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): """ @@ -1536,7 +1536,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None ) return [ - github.Issue.Issue(self._requester, github.Legacy.convertIssue(element), completed=False) + github.Issue.Issue(self._requester, headers, github.Legacy.convertIssue(element), completed=False) for element in data["issues"] ] From 8f2ba4f522dbae090b8287663a9a1a88283803b4 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:13:22 +0800 Subject: [PATCH 41/59] Update IssueComment.py --- github/Issue.py | 4 ++-- github/IssueComment.py | 3 --- github/PullRequest.py | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index 502263de..0c2dfc21 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -217,7 +217,7 @@ class Issue(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, headers, data, completed=True) def delete_labels(self): """ @@ -282,7 +282,7 @@ class Issue(github.GithubObject.CompletableGithubObject): None, None ) - return github.IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, headers, data, completed=True) def get_comments(self): """ diff --git a/github/IssueComment.py b/github/IssueComment.py index d39470ab..5e9e5099 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -33,9 +33,6 @@ class IssueComment(github.GithubObject.CompletableGithubObject): """ This class represents IssueComments as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/PullRequest.py b/github/PullRequest.py index 32c213c5..aeaa2508 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -315,7 +315,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, headers, data, completed=True) def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, state=github.GithubObject.NotSet): """ @@ -422,7 +422,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, None ) - return github.IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, headers, data, completed=True) def get_issue_comments(self): """ From 7d40b9eae87fb1631f358e3c09a9d691a942f258 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:17:26 +0800 Subject: [PATCH 42/59] Update IssueEvent.py --- github/IssueEvent.py | 3 --- github/Repository.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/github/IssueEvent.py b/github/IssueEvent.py index aa64f355..3d05a8c7 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -33,9 +33,6 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): """ This class represents IssueEvents as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def actor(self): diff --git a/github/Repository.py b/github/Repository.py index c364b058..49530a69 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1212,7 +1212,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.IssueEvent.IssueEvent(self._requester, data, completed=True) + return github.IssueEvent.IssueEvent(self._requester, headers, data, completed=True) def get_issues_events(self): """ From 175488270a65a97a42c7bc3fd0bf42676ea4a6e3 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:21:22 +0800 Subject: [PATCH 43/59] Update Label.py --- github/Issue.py | 2 +- github/Label.py | 3 --- github/Repository.py | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index 0c2dfc21..6a863638 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -401,7 +401,7 @@ class Issue(github.GithubObject.CompletableGithubObject): if "labels" in attributes: # pragma no branch assert attributes["labels"] is None or all(isinstance(element, dict) for element in attributes["labels"]), attributes["labels"] self._labels = None if attributes["labels"] is None else [ - github.Label.Label(self._requester, element, completed=False) + github.Label.Label(self._requester, self._headers, element, completed=False) for element in attributes["labels"] ] if "milestone" in attributes: # pragma no branch diff --git a/github/Label.py b/github/Label.py index e09082ff..e2d42335 100644 --- a/github/Label.py +++ b/github/Label.py @@ -33,9 +33,6 @@ class Label(github.GithubObject.CompletableGithubObject): """ This class represents Labels. The reference can be found here http://developer.github.com/v3/issues/labels/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def color(self): diff --git a/github/Repository.py b/github/Repository.py index 49530a69..12de729f 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -599,7 +599,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Label.Label(self._requester, data, completed=True) + return github.Label.Label(self._requester, headers, data, completed=True) def create_milestone(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet): """ @@ -1266,7 +1266,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Label.Label(self._requester, data, completed=True) + return github.Label.Label(self._requester, headers, data, completed=True) def get_labels(self): """ From e4baf577ed5445bbc156c123ccbd7da3c1a3b650 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:24:27 +0800 Subject: [PATCH 44/59] Update Milestone.py --- github/Issue.py | 2 +- github/Milestone.py | 3 --- github/Repository.py | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index 6a863638..e539cef4 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -406,7 +406,7 @@ class Issue(github.GithubObject.CompletableGithubObject): ] if "milestone" in attributes: # pragma no branch assert attributes["milestone"] is None or isinstance(attributes["milestone"], dict), attributes["milestone"] - self._milestone = None if attributes["milestone"] is None else github.Milestone.Milestone(self._requester, attributes["milestone"], completed=False) + self._milestone = None if attributes["milestone"] is None else github.Milestone.Milestone(self._requester, self._headers, attributes["milestone"], completed=False) if "number" in attributes: # pragma no branch assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] diff --git a/github/Milestone.py b/github/Milestone.py index 2650d24b..9611d7b7 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -37,9 +37,6 @@ class Milestone(github.GithubObject.CompletableGithubObject): """ This class represents Milestones. The reference can be found here http://developer.github.com/v3/issues/milestones/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def closed_issues(self): diff --git a/github/Repository.py b/github/Repository.py index 12de729f..93fa581a 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -629,7 +629,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Milestone.Milestone(self._requester, data, completed=True) + return github.Milestone.Milestone(self._requester, headers, data, completed=True) def create_pull(self, *args, **kwds): """ @@ -1306,7 +1306,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.Milestone.Milestone(self._requester, data, completed=True) + return github.Milestone.Milestone(self._requester, headers, data, completed=True) def get_milestones(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): """ From ba6800ada4213828bdb4f5d54d14e0d4c3c25c4c Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:57:10 +0800 Subject: [PATCH 45/59] Update NamedUser.py --- github/Commit.py | 4 ++-- github/CommitComment.py | 17 ++++++++++++++++- github/CommitStatus.py | 2 +- github/Event.py | 2 +- github/Gist.py | 17 ++++++++++++++++- github/GistComment.py | 17 ++++++++++++++++- github/GistHistoryState.py | 14 +++++++++++++- github/Issue.py | 21 ++++++++++++++++++--- github/IssueComment.py | 17 ++++++++++++++++- github/IssueEvent.py | 2 +- github/Legacy.py | 14 ++++++++++---- github/MainClass.py | 18 ++++++++++++++---- github/Milestone.py | 2 +- github/NamedUser.py | 3 --- github/PullRequest.py | 21 ++++++++++++++++++--- github/PullRequestComment.py | 17 ++++++++++++++++- github/PullRequestPart.py | 12 +++++++++++- github/Repository.py | 2 +- 18 files changed, 171 insertions(+), 31 deletions(-) diff --git a/github/Commit.py b/github/Commit.py index 0fba1935..e71399fd 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -201,13 +201,13 @@ class Commit(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "author" in attributes: # pragma no branch assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] - self._author = None if attributes["author"] is None else github.NamedUser.NamedUser(self._requester, attributes["author"], completed=False) + self._author = None if attributes["author"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["author"], completed=False) if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] self._commit = None if attributes["commit"] is None else github.GitCommit.GitCommit(self._requester, self._headers, attributes["commit"], completed=False) if "committer" in attributes: # pragma no branch assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] - self._committer = None if attributes["committer"] is None else github.NamedUser.NamedUser(self._requester, attributes["committer"], completed=False) + self._committer = None if attributes["committer"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["committer"], completed=False) if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] self._files = None if attributes["files"] is None else [ diff --git a/github/CommitComment.py b/github/CommitComment.py index 30f1df3a..e5dcc883 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -197,4 +197,19 @@ class CommitComment(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 122c55c4..e40af474 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -97,7 +97,7 @@ class CommitStatus(github.GithubObject.NonCompletableGithubObject): self._created_at = self._parseDatetime(attributes["created_at"]) if "creator" in attributes: # pragma no branch assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] - self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["creator"], completed=False) if "description" in attributes: # pragma no branch assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] diff --git a/github/Event.py b/github/Event.py index 60e7c863..1670782e 100644 --- a/github/Event.py +++ b/github/Event.py @@ -105,7 +105,7 @@ class Event(github.GithubObject.NonCompletableGithubObject): def _useAttributes(self, attributes): if "actor" in attributes: # pragma no branch assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] - self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["actor"], completed=False) if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) diff --git a/github/Gist.py b/github/Gist.py index 69498746..3dcf1d18 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -358,4 +358,19 @@ class Gist(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/GistComment.py b/github/GistComment.py index 2bb28abd..c2e3e3bd 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -137,4 +137,19 @@ class GistComment(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 2f095558..374782b7 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -93,7 +93,19 @@ class GistHistoryState(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) if "version" in attributes: # pragma no branch assert attributes["version"] is None or isinstance(attributes["version"], (str, unicode)), attributes["version"] self._version = attributes["version"] + + + + + + + + + + + + diff --git a/github/Issue.py b/github/Issue.py index e539cef4..ec3923b9 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -376,7 +376,7 @@ class Issue(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] - self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) + self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["assignee"], completed=False) if "body" in attributes: # pragma no branch assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] self._body = attributes["body"] @@ -385,7 +385,7 @@ class Issue(github.GithubObject.CompletableGithubObject): self._closed_at = self._parseDatetime(attributes["closed_at"]) if "closed_by" in attributes: # pragma no branch assert attributes["closed_by"] is None or isinstance(attributes["closed_by"], dict), attributes["closed_by"] - self._closed_by = None if attributes["closed_by"] is None else github.NamedUser.NamedUser(self._requester, attributes["closed_by"], completed=False) + self._closed_by = None if attributes["closed_by"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["closed_by"], completed=False) if "comments" in attributes: # pragma no branch assert attributes["comments"] is None or isinstance(attributes["comments"], (int, long)), attributes["comments"] self._comments = attributes["comments"] @@ -430,4 +430,19 @@ class Issue(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/IssueComment.py b/github/IssueComment.py index 5e9e5099..419af317 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -150,4 +150,19 @@ class IssueComment(github.GithubObject.CompletableGithubObject): self._html_url = attributes["html_url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 3d05a8c7..0fb54291 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -102,7 +102,7 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): def _useAttributes(self, attributes): if "actor" in attributes: # pragma no branch assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] - self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["actor"], completed=False) if "commit_id" in attributes: # pragma no branch assert attributes["commit_id"] is None or isinstance(attributes["commit_id"], (str, unicode)), attributes["commit_id"] self._commit_id = attributes["commit_id"] diff --git a/github/Legacy.py b/github/Legacy.py index 599ca605..2f36f4a3 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -61,10 +61,16 @@ class PaginatedList(github.PaginatedList.PaginatedListBase): None ) self.__continue = len(data[self.__key]) > 0 - return [ - self.__contentClass(self.__requester, self.__convert(element), completed=False) - for element in data[self.__key] - ] + try: + return [ + self.__contentClass(self.__requester, headers, self.__convert(element), completed=False) + for element in data[self.__key] + ] + except TypeError: + return [ + self.__contentClass(self.__requester, self.__convert(element), completed=False) + for element in data[self.__key] + ] def convertUser(attributes): diff --git a/github/MainClass.py b/github/MainClass.py index 182c8c2f..394eddb0 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -122,7 +122,7 @@ class Github(object): None, None ) - return github.NamedUser.NamedUser(self.__requester, data, completed=True) + return github.NamedUser.NamedUser(self.__requester, headers, data, completed=True) def get_users(self, since=github.GithubObject.NotSet): """ @@ -245,7 +245,7 @@ class Github(object): None, None ) - return github.NamedUser.NamedUser(self.__requester, Legacy.convertUser(data["user"]), completed=False) + return github.NamedUser.NamedUser(self.__requester, headers, Legacy.convertUser(data["user"]), completed=False) def render_markdown(self, text, context=github.GithubObject.NotSet): """ @@ -310,7 +310,7 @@ class Github(object): ) return GitignoreTemplate.GitignoreTemplate(self.__requester, headers, attributes, completed=True) - def create_from_raw_data(self, klass, raw_data): + def create_from_raw_data(self, klass, raw_data, headers = {}): """ Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data` @@ -318,4 +318,14 @@ class Github(object): :param raw_data: dict :rtype: instance of class ``klass`` """ - return klass(self.__requester, raw_data, completed=True) + return klass(self.__requester, headers, raw_data, completed=True) + + + + + + + + + + diff --git a/github/Milestone.py b/github/Milestone.py index 9611d7b7..614b8d0e 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -206,7 +206,7 @@ class Milestone(github.GithubObject.CompletableGithubObject): self._created_at = self._parseDatetime(attributes["created_at"]) if "creator" in attributes: # pragma no branch assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] - self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["creator"], completed=False) if "description" in attributes: # pragma no branch assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] diff --git a/github/NamedUser.py b/github/NamedUser.py index 3f979fca..7bfa3ff1 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -39,9 +39,6 @@ class NamedUser(github.GithubObject.CompletableGithubObject): """ This class represents NamedUsers as returned for example by http://developer.github.com/v3/todo """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/PullRequest.py b/github/PullRequest.py index aeaa2508..2dc0e82c 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -502,7 +502,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._additions = attributes["additions"] if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] - self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) + self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] self._base = None if attributes["base"] is None else github.PullRequestPart.PullRequestPart(self._requester, self._headers, attributes["base"], completed=False) @@ -553,7 +553,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._merged_at = self._parseDatetime(attributes["merged_at"]) if "merged_by" in attributes: # pragma no branch assert attributes["merged_by"] is None or isinstance(attributes["merged_by"], dict), attributes["merged_by"] - self._merged_by = None if attributes["merged_by"] is None else github.NamedUser.NamedUser(self._requester, attributes["merged_by"], completed=False) + self._merged_by = None if attributes["merged_by"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["merged_by"], completed=False) if "number" in attributes: # pragma no branch assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] @@ -577,4 +577,19 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 31be092b..4cf15d63 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -214,4 +214,19 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject): self._html_url = attributes["html_url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + + + + + + diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 99778645..837b7bf0 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -91,4 +91,14 @@ class PullRequestPart(github.GithubObject.NonCompletableGithubObject): self._sha = attributes["sha"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) + + + + + + + + + + diff --git a/github/Repository.py b/github/Repository.py index 93fa581a..3319d30a 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1716,7 +1716,7 @@ class Repository(github.GithubObject.CompletableGithubObject): self._organization = None if attributes["organization"] is None else github.Organization.Organization(self._requester, attributes["organization"], completed=False) if "owner" in attributes: # pragma no branch assert attributes["owner"] is None or isinstance(attributes["owner"], dict), attributes["owner"] - self._owner = None if attributes["owner"] is None else github.NamedUser.NamedUser(self._requester, attributes["owner"], completed=False) + 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) From 6cb6e8d232f84e7456c184a4cd055281bb0dba07 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 16:58:25 +0800 Subject: [PATCH 46/59] Update Notification.py --- github/AuthenticatedUser.py | 2 +- github/Notification.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 93417fe4..75caa57c 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -707,7 +707,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.Notification.Notification(self._requester, data, completed=True) + return github.Notification.Notification(self._requester, headers, data, completed=True) def get_notifications(self, all=github.GithubObject.NotSet, participating=github.GithubObject.NotSet): """ diff --git a/github/Notification.py b/github/Notification.py index 433cfcd3..f6f89fa5 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -33,9 +33,6 @@ class Notification(github.GithubObject.CompletableGithubObject): """ This class represents Notifications. The reference can be found here http://developer.github.com/v3/activity/notifications/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): From ef912af6b79414351de245aa7a6919cad461ca50 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:01:13 +0800 Subject: [PATCH 47/59] Update Organization.py --- github/Event.py | 5 ++++- github/MainClass.py | 2 +- github/Organization.py | 3 --- github/Repository.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/github/Event.py b/github/Event.py index 1670782e..cd45e14c 100644 --- a/github/Event.py +++ b/github/Event.py @@ -114,7 +114,7 @@ class Event(github.GithubObject.NonCompletableGithubObject): self._id = attributes["id"] if "org" in attributes: # pragma no branch assert attributes["org"] is None or isinstance(attributes["org"], dict), attributes["org"] - self._org = None if attributes["org"] is None else github.Organization.Organization(self._requester, attributes["org"], completed=False) + self._org = None if attributes["org"] is None else github.Organization.Organization(self._requester, self._headers, attributes["org"], completed=False) if "payload" in attributes: # pragma no branch assert attributes["payload"] is None or isinstance(attributes["payload"], dict), attributes["payload"] self._payload = attributes["payload"] @@ -127,3 +127,6 @@ class Event(github.GithubObject.NonCompletableGithubObject): 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/MainClass.py b/github/MainClass.py index 394eddb0..44e22df1 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -154,7 +154,7 @@ class Github(object): None, None ) - return github.Organization.Organization(self.__requester, data, completed=True) + return github.Organization.Organization(self.__requester, headers, data, completed=True) def get_repo(self, full_name): """ diff --git a/github/Organization.py b/github/Organization.py index 16db918d..bf341419 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -41,9 +41,6 @@ class Organization(github.GithubObject.CompletableGithubObject): """ This class represents Organizations. The reference can be found here http://developer.github.com/v3/orgs/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def avatar_url(self): diff --git a/github/Repository.py b/github/Repository.py index 3319d30a..32c93e5a 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1713,7 +1713,7 @@ class Repository(github.GithubObject.CompletableGithubObject): self._open_issues = attributes["open_issues"] if "organization" in attributes: # pragma no branch assert attributes["organization"] is None or isinstance(attributes["organization"], dict), attributes["organization"] - self._organization = None if attributes["organization"] is None else github.Organization.Organization(self._requester, attributes["organization"], completed=False) + self._organization = None if attributes["organization"] is None else github.Organization.Organization(self._requester, self._headers, attributes["organization"], completed=False) if "owner" in attributes: # pragma no branch assert attributes["owner"] is None or isinstance(attributes["owner"], dict), attributes["owner"] self._owner = None if attributes["owner"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["owner"], completed=False) From 0e842637a6052129b1706419a66597f419b4b2ba Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:03:41 +0800 Subject: [PATCH 48/59] Update PullRequest.py --- github/PullRequest.py | 7 ++----- github/PullRequestComment.py | 3 --- github/Repository.py | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/github/PullRequest.py b/github/PullRequest.py index 2dc0e82c..fa36d470 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -41,9 +41,6 @@ class PullRequest(github.GithubObject.CompletableGithubObject): """ This class represents PullRequests. The reference can be found here http://developer.github.com/v3/pulls/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def additions(self): @@ -297,7 +294,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True) + return github.PullRequestComment.PullRequestComment(self._requester, headers, data, completed=True) def create_issue_comment(self, body): """ @@ -364,7 +361,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, None ) - return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True) + return github.PullRequestComment.PullRequestComment(self._requester, headers, data, completed=True) def get_comments(self): """ diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 4cf15d63..dcddc247 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -34,9 +34,6 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject): """ This class represents PullRequestComments. The reference can be found here http://developer.github.com/v3/pulls/comments/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def body(self): diff --git a/github/Repository.py b/github/Repository.py index 32c93e5a..5c305d9e 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -667,7 +667,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.PullRequest.PullRequest(self._requester, data, completed=True) + return github.PullRequest.PullRequest(self._requester, headers, data, completed=True) def delete(self): """ @@ -1358,7 +1358,7 @@ class Repository(github.GithubObject.CompletableGithubObject): None, None ) - return github.PullRequest.PullRequest(self._requester, data, completed=True) + return github.PullRequest.PullRequest(self._requester, headers, data, completed=True) def get_pulls(self, state=github.GithubObject.NotSet): """ From 3c1d17cd649e79ff7c97d2c68daffbf6529ed969 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:13:03 +0800 Subject: [PATCH 49/59] Update Repository.py --- github/AuthenticatedUser.py | 6 +++--- github/Event.py | 6 +++++- github/Issue.py | 2 +- github/MainClass.py | 2 +- github/NamedUser.py | 2 +- github/Notification.py | 2 +- github/Organization.py | 6 +++--- github/PullRequestPart.py | 2 +- github/Repository.py | 7 ++----- 9 files changed, 18 insertions(+), 17 deletions(-) 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"] From 1070631c73f02e1ee6b03c55155086d33791499e Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:18:01 +0800 Subject: [PATCH 50/59] Update Team.py --- github/Organization.py | 4 ++-- github/Team.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/Organization.py b/github/Organization.py index 43112110..ad5ef571 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -344,7 +344,7 @@ class Organization(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.Team.Team(self._requester, data, completed=True) + return github.Team.Team(self._requester, headers, data, completed=True) def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet): """ @@ -503,7 +503,7 @@ class Organization(github.GithubObject.CompletableGithubObject): None, None ) - return github.Team.Team(self._requester, data, completed=True) + return github.Team.Team(self._requester, headers, data, completed=True) def get_teams(self): """ diff --git a/github/Team.py b/github/Team.py index 0637d057..b6d681d6 100644 --- a/github/Team.py +++ b/github/Team.py @@ -35,9 +35,6 @@ class Team(github.GithubObject.CompletableGithubObject): """ This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): From c4e8972be12ba249a06cd4c40499e0b32011e7f5 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:19:11 +0800 Subject: [PATCH 51/59] Update UserKey.py --- github/AuthenticatedUser.py | 4 ++-- github/UserKey.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 6fd4c16b..151124e1 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -409,7 +409,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, post_parameters ) - return github.UserKey.UserKey(self._requester, data, completed=True) + return github.UserKey.UserKey(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, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet): """ @@ -680,7 +680,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): None, None ) - return github.UserKey.UserKey(self._requester, data, completed=True) + return github.UserKey.UserKey(self._requester, headers, data, completed=True) def get_keys(self): """ diff --git a/github/UserKey.py b/github/UserKey.py index 392a0b64..222cd1a5 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -31,9 +31,6 @@ class UserKey(github.GithubObject.CompletableGithubObject): """ This class represents UserKeys. The reference can be found here http://developer.github.com/v3/users/keys/ """ - def __init__(self, requester, attributes, completed): - # Adapte for __init__ change, remove later - github.GithubObject.CompletableGithubObject.__init__(self, requester, {}, attributes, completed) @property def id(self): From 8a301701db354408b63273f78ece6887a1677e55 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:25:29 +0800 Subject: [PATCH 52/59] Remove helper method in PaginatedList.py --- github/PaginatedList.py | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 1ab477e1..ff4a306e 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -113,23 +113,6 @@ class PaginatedList(PaginatedListBase): def _couldGrow(self): return self.__nextUrl is not None - - def makePage(self, headers, data): - ''' - Adapte for diffrent __init__ signature in refactoring, remove when done - ''' - - try: # Try use old __init__ signature - return [ - self.__contentClass(self.__requester, element, completed=False) - for element in data] - except TypeError: # must be new - return [ - self.__contentClass(self.__requester, headers, element, completed=False) - for element in data] - - - def _fetchNextPage(self): headers, data = self.__requester.requestJsonAndCheck("GET", self.__nextUrl, self.__nextParams, None) @@ -141,7 +124,10 @@ class PaginatedList(PaginatedListBase): self.__nextUrl = None self.__nextParams = None - return self.makePage(headers, data) + return [ + self.__contentClass(self.__requester, headers, element, completed=False) + for element in data] + def __parseLinkHeader(self, headers): links = {} @@ -162,4 +148,7 @@ class PaginatedList(PaginatedListBase): params["per_page"] = self.__requester.per_page headers, data = self.__requester.requestJsonAndCheck("GET", self.__firstUrl, params, None) - return self.makePage(headers, data) + return [ + self.__contentClass(self.__requester, headers, element, completed=False) + for element in data] + From 3f6d1b6b705de6ea9632021987e55d41875f0102 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:27:37 +0800 Subject: [PATCH 53/59] Remove helper method in Legacy.py --- github/Legacy.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/github/Legacy.py b/github/Legacy.py index 2f36f4a3..9789e673 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -61,16 +61,12 @@ class PaginatedList(github.PaginatedList.PaginatedListBase): None ) self.__continue = len(data[self.__key]) > 0 - try: - return [ - self.__contentClass(self.__requester, headers, self.__convert(element), completed=False) - for element in data[self.__key] - ] - except TypeError: - return [ - self.__contentClass(self.__requester, self.__convert(element), completed=False) - for element in data[self.__key] - ] + + return [ + self.__contentClass(self.__requester, headers, self.__convert(element), completed=False) + for element in data[self.__key] + ] + def convertUser(attributes): From 30d9d499a1b44552ab9a28ef7317aa2098daafd7 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:32:32 +0800 Subject: [PATCH 54/59] Clean up --- github/GithubObject.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github/GithubObject.py b/github/GithubObject.py index 077cc5c2..efc7dcef 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -40,6 +40,8 @@ class GithubObject(object): """ def __init__(self, requester, headers, attributes, completed): self._requester = requester + # Make sure headers are signed before any operations on attributes + # Object creatation requires headers as parameter self._headers = headers; self._initAttributes() self._storeAndUseAttributes(attributes) @@ -86,7 +88,6 @@ class NonCompletableGithubObject(GithubObject): class CompletableGithubObject(GithubObject): def __init__(self, requester, headers, attributes, completed): - # Adapte for __init__ change, remove later GithubObject.__init__(self, requester, headers, attributes, completed) self.__completed = completed From 912bec79d2dd2479e5e32118c66ee9a647b46332 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 17:45:01 +0800 Subject: [PATCH 55/59] Update copyright information --- github/AuthenticatedUser.py | 1 + github/Authorization.py | 1 + github/Branch.py | 1 + github/Commit.py | 1 + github/CommitComment.py | 1 + github/CommitStatus.py | 1 + github/Comparison.py | 1 + github/Event.py | 1 + github/Gist.py | 1 + github/GistComment.py | 1 + github/GistHistoryState.py | 1 + github/GitCommit.py | 1 + github/GitRef.py | 1 + github/GitTag.py | 1 + github/GitTree.py | 1 + github/GithubObject.py | 1 + github/Hook.py | 1 + github/Issue.py | 1 + github/IssueComment.py | 1 + github/IssueEvent.py | 1 + github/Legacy.py | 1 + github/MainClass.py | 1 + github/Milestone.py | 1 + github/NamedUser.py | 1 + github/Notification.py | 1 + github/Organization.py | 1 + github/PaginatedList.py | 1 + github/PullRequest.py | 1 + github/PullRequestComment.py | 1 + github/PullRequestPart.py | 1 + github/Repository.py | 1 + github/RepositoryKey.py | 1 + github/Tag.py | 1 + 33 files changed, 33 insertions(+) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 151124e1..57e792da 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -6,6 +6,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Authorization.py b/github/Authorization.py index ef61ed84..5228ed31 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Branch.py b/github/Branch.py index 5004f2f6..fef7aa8a 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Commit.py b/github/Commit.py index e71399fd..9e2b266b 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/CommitComment.py b/github/CommitComment.py index e5dcc883..5ce52f75 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/CommitStatus.py b/github/CommitStatus.py index e40af474..4b9602a7 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Comparison.py b/github/Comparison.py index a0a3d6de..cfebc0c0 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Event.py b/github/Event.py index aefc3ca9..b9752ec1 100644 --- a/github/Event.py +++ b/github/Event.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Gist.py b/github/Gist.py index 3dcf1d18..c7294a08 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -6,6 +6,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GistComment.py b/github/GistComment.py index c2e3e3bd..c832338a 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 374782b7..13762e2a 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitCommit.py b/github/GitCommit.py index ab012fba..a281e491 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitRef.py b/github/GitRef.py index 9ff4f30f..8fe1945e 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitTag.py b/github/GitTag.py index 58a34598..0ffb00e0 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitTree.py b/github/GitTree.py index f999de89..570bfee4 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GithubObject.py b/github/GithubObject.py index efc7dcef..ab55d52a 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Hook.py b/github/Hook.py index 4366b559..d59b5afd 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Issue.py b/github/Issue.py index 01bffcfd..eb58e20e 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -7,6 +7,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/IssueComment.py b/github/IssueComment.py index 419af317..254398c1 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Michael Stead # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 0fb54291..0a897a69 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Legacy.py b/github/Legacy.py index 9789e673..4270f7a5 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -6,6 +6,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/MainClass.py b/github/MainClass.py index 2b1db292..19531a48 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -5,6 +5,7 @@ # Copyright 2013 Jonathan J Hunt # # Copyright 2013 Peter Golm # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Milestone.py b/github/Milestone.py index 614b8d0e..47b7c0bb 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/NamedUser.py b/github/NamedUser.py index 09927bae..df30b919 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -6,6 +6,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Notification.py b/github/Notification.py index 58957495..29c06b53 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -5,6 +5,7 @@ # Copyright 2013 Peter Golm # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Organization.py b/github/Organization.py index ad5ef571..fb2fe969 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -7,6 +7,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/PaginatedList.py b/github/PaginatedList.py index ff4a306e..f4f81d85 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -7,6 +7,7 @@ # Copyright 2013 Bill Mill # # Copyright 2013 Vincent Jacques # # Copyright 2013 davidbrai # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/PullRequest.py b/github/PullRequest.py index fa36d470..05438de8 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -7,6 +7,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index dcddc247..b51eb8a1 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -7,6 +7,7 @@ # Copyright 2013 Michael Stead # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 3c770025..8c5dcb43 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Repository.py b/github/Repository.py index b4bbb476..4bbad55c 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -9,6 +9,7 @@ # Copyright 2013 Mark Roddy # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 9a7c7b28..91efacf2 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -7,6 +7,7 @@ # Copyright 2013 Srijan Choudhary # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Tag.py b/github/Tag.py index 9300b607..4ac411ab 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -6,6 +6,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # From 1d18ea75cce3ca6aeff03d0343e65b2f13b97f80 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 19:25:05 +0800 Subject: [PATCH 56/59] Add debug / test mechanism --- github/GithubObject.py | 11 ++++++++ github/Requester.py | 63 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/github/GithubObject.py b/github/GithubObject.py index ab55d52a..760afad9 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -39,6 +39,12 @@ class GithubObject(object): """ Base class for all classes representing objects returned by the API. """ + + ''' + A global debug flag to enable header validation by requester for all objects + ''' + CHECK_AFTER_INIT_FLAG = False + def __init__(self, requester, headers, attributes, completed): self._requester = requester # Make sure headers are signed before any operations on attributes @@ -47,6 +53,11 @@ class GithubObject(object): self._initAttributes() self._storeAndUseAttributes(attributes) + # Ask requester to do some checking, for debug and test purpose + # Since it's most handy to access and kinda all-knowing + if (GithubObject.CHECK_AFTER_INIT_FLAG): + requester.check_me(self); + def _storeAndUseAttributes(self, attributes): self._useAttributes(attributes) self._rawData = attributes diff --git a/github/Requester.py b/github/Requester.py index ca263e0a..c08940ba 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -11,6 +11,7 @@ # Copyright 2012 Zearin # # Copyright 2013 Jonathan J Hunt # # Copyright 2013 Vincent Jacques # +# Copyright 2013 akfish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -60,8 +61,65 @@ class Requester: def resetConnectionClasses(cls): cls.__httpConnectionClass = httplib.HTTPConnection cls.__httpsConnectionClass = httplib.HTTPSConnection + + ############################################################# + # For Debug + + DEBUG_FLAG = False + + DEBUG_FRAME_BUFFER_SIZE = 1024 + + DEBUG_HEADER_KEY = "DEBUG_FRAME" + + def NEW_DEBUG_FRAME(self, requestHeader): + ''' + Initialize a debug frame with requestHeader + Frame count is updated and will be attached to respond header + The structure of a frame: [requestHeader, statusCode, responseHeader, raw_data] + Some of them may be None + ''' + if not self.DEBUG_FLAG: + return + + new_frame = [requestHeader, None, None, None] + if self._frameCount < self.DEBUG_FRAME_BUFFER_SIZE - 1: + self._frameBuffer.append(new_frame) + else: + self._frameBuffer[0] = new_frame + + self._frameCount = len(self._frameBuffer) - 1 + + def DEBUG_ON_RESPONSE(self, statusCode, responseHeader, data): + ''' + Update current frame with response + Current frame index will be attached to responseHeader + ''' + if not self.DEBUG_FLAG: + return + + self._frameBuffer[self._frameCount][1:4] = [statusCode, responseHeader, data] + responseHeader[self.DEBUG_HEADER_KEY] = self._frameCount + + + def check_me(self, obj): + if self.DEBUG_FLAG and self.onCheckMe is not None: + frame = None + if self.DEBUG_HEADER_KEY in obj._headers: + frame_index = obj._headers[self.DEBUG_HEADER_KEY] + frame = self._frameBuffer[frame_index] + onCheckMe(self, obj, frame) + + def _initializeDebugFeature(self): + if not self.DEBUG_FLAG: + return + self.onCheckMe = None + self._frameCount = 0 + self._frameBuffer = [] + ############################################################# def __init__(self, login_or_token, password, base_url, timeout, client_id, client_secret, user_agent, per_page): + self._initializeDebugFeature() + if password is not None: login = login_or_token if atLeastPython3: @@ -108,6 +166,9 @@ class Requester: def __check(self, status, responseHeaders, output): output = self.__structuredFromJson(output) + # Log frame + self.DEBUG_ON_RESPONSE(status, responseHeaders, output) + if status >= 400: raise self.__createException(status, output) return responseHeaders, output @@ -171,6 +232,8 @@ class Requester: if input is not None: requestHeaders["Content-Type"], encoded_input = encode(input) + self.NEW_DEBUG_FRAME(requestHeaders) + status, responseHeaders, output = self.__requestRaw(verb, url, requestHeaders, encoded_input) if "x-ratelimit-remaining" in responseHeaders and "x-ratelimit-limit" in responseHeaders: From e06257d06017b72bb57b15b043e6f16d4b6eb568 Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 20:58:29 +0800 Subject: [PATCH 57/59] Enable debug in TestCase --- github/GithubObject.py | 6 +++++- github/Requester.py | 16 +++++++++++----- github/tests/Framework.py | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/github/GithubObject.py b/github/GithubObject.py index 760afad9..3fc89992 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -45,6 +45,10 @@ class GithubObject(object): ''' CHECK_AFTER_INIT_FLAG = False + @classmethod + def setCheckAfterInitFlag(cls, flag): + cls.CHECK_AFTER_INIT_FLAG = flag + def __init__(self, requester, headers, attributes, completed): self._requester = requester # Make sure headers are signed before any operations on attributes @@ -55,7 +59,7 @@ class GithubObject(object): # Ask requester to do some checking, for debug and test purpose # Since it's most handy to access and kinda all-knowing - if (GithubObject.CHECK_AFTER_INIT_FLAG): + if (self.CHECK_AFTER_INIT_FLAG): requester.check_me(self); def _storeAndUseAttributes(self, attributes): diff --git a/github/Requester.py b/github/Requester.py index c08940ba..7d944c3e 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -64,6 +64,13 @@ class Requester: ############################################################# # For Debug + @classmethod + def setDebugFlag(cls, flag): + cls.DEBUG_FLAG = flag + + @classmethod + def setOnCheckMe(cls, onCheckMe): + cls.ON_CHECK_ME = onCheckMe DEBUG_FLAG = False @@ -71,6 +78,8 @@ class Requester: DEBUG_HEADER_KEY = "DEBUG_FRAME" + ON_CHECK_ME = None + def NEW_DEBUG_FRAME(self, requestHeader): ''' Initialize a debug frame with requestHeader @@ -102,17 +111,14 @@ class Requester: def check_me(self, obj): - if self.DEBUG_FLAG and self.onCheckMe is not None: + if self.DEBUG_FLAG and self.ON_CHECK_ME is not None: frame = None if self.DEBUG_HEADER_KEY in obj._headers: frame_index = obj._headers[self.DEBUG_HEADER_KEY] frame = self._frameBuffer[frame_index] - onCheckMe(self, obj, frame) + self.ON_CHECK_ME(obj, frame) def _initializeDebugFeature(self): - if not self.DEBUG_FLAG: - return - self.onCheckMe = None self._frameCount = 0 self._frameBuffer = [] ############################################################# diff --git a/github/tests/Framework.py b/github/tests/Framework.py index 706bdbdd..bc0f5028 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -244,10 +244,30 @@ class BasicTestCase(unittest.TestCase): class TestCase(BasicTestCase): + def doCheckFrame(self, obj, frame): + pass + + + def getFrameChecker(self): + return lambda requester, obj, frame: self.doCheckFrame(obj, frame) + def setUp(self): BasicTestCase.setUp(self) + + # Set up frame debugging + + github.GithubObject.GithubObject.setCheckAfterInitFlag(True) + + github.Requester.Requester.setDebugFlag(True) + + github.Requester.Requester.setOnCheckMe(self.getFrameChecker()) + self.g = github.Github(self.login, self.password) + + + def activateRecordMode(): # pragma no cover (Function useful only when recording new tests, not used during automated tests) BasicTestCase.recordMode = True + From aa3025271cd918883b31a42fb7b4ce03027b805c Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 21:11:12 +0800 Subject: [PATCH 58/59] Assert response headers --- github/tests/Framework.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/github/tests/Framework.py b/github/tests/Framework.py index bc0f5028..24a359bd 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -245,7 +245,11 @@ class BasicTestCase(unittest.TestCase): class TestCase(BasicTestCase): def doCheckFrame(self, obj, frame): - pass + if obj._headers == {} and frame is None: + return + if obj._headers is None and frame == {}: + return + self.assertEqual(obj._headers, frame[2]); def getFrameChecker(self): From 5c475c7683b2a57ee053d35586248f24febb6ebe Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Aug 2013 10:12:38 +0200 Subject: [PATCH 59/59] First review of #192 (pep8, headers... nothing important) ./manage.sh check ./manage.sh fix_headers --- .gitignore | 7 ++++--- github/AuthenticatedUser.py | 2 +- github/Authorization.py | 2 +- github/AuthorizationApplication.py | 1 + github/Branch.py | 2 +- github/Commit.py | 2 +- github/CommitComment.py | 17 +---------------- github/CommitStats.py | 1 + github/CommitStatus.py | 2 +- github/Comparison.py | 2 +- github/ContentFile.py | 1 + github/Download.py | 1 + github/Event.py | 9 +-------- github/File.py | 1 + github/Gist.py | 17 +---------------- github/GistComment.py | 17 +---------------- github/GistFile.py | 1 + github/GistHistoryState.py | 14 +------------- github/GitAuthor.py | 1 + github/GitBlob.py | 1 + github/GitCommit.py | 14 +------------- github/GitObject.py | 1 + github/GitRef.py | 2 +- github/GitTag.py | 14 +------------- github/GitTree.py | 7 +------ github/GitTreeElement.py | 1 + github/GithubObject.py | 2 +- github/GitignoreTemplate.py | 1 + github/Hook.py | 3 +-- github/HookDescription.py | 1 + github/HookResponse.py | 1 + github/Issue.py | 17 +---------------- github/IssueComment.py | 17 +---------------- github/IssueEvent.py | 14 +------------- github/IssuePullRequest.py | 1 + github/Label.py | 1 + github/Legacy.py | 3 +-- github/MainClass.py | 16 +++------------- github/Milestone.py | 2 +- github/NamedUser.py | 2 +- github/Notification.py | 5 +---- github/NotificationSubject.py | 1 + github/Organization.py | 2 +- github/PaginatedList.py | 12 ++++++------ github/Permissions.py | 1 + github/Plan.py | 1 + github/PullRequest.py | 19 ++----------------- github/PullRequestComment.py | 17 +---------------- github/PullRequestMergeStatus.py | 1 + github/PullRequestPart.py | 12 +----------- github/Repository.py | 2 +- github/RepositoryKey.py | 2 +- github/Requester.py | 8 ++++---- github/Tag.py | 2 +- github/Team.py | 1 + github/UserKey.py | 1 + github/tests/Framework.py | 15 ++++----------- 57 files changed, 74 insertions(+), 249 deletions(-) diff --git a/.gitignore b/.gitignore index 3a7eff09..6ff70a1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # @@ -28,6 +29,6 @@ GithubCredentials.py /PyGithub.egg-info/ /.coverage /developer.github.com/ - -*.cfg -*.bat + +*.cfg +*.bat diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 57e792da..e035f9a1 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -5,8 +5,8 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Authorization.py b/github/Authorization.py index 5228ed31..2289fd34 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index 392ec78c..8f38bc14 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Branch.py b/github/Branch.py index fef7aa8a..9e761826 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Commit.py b/github/Commit.py index 9e2b266b..5e909213 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/CommitComment.py b/github/CommitComment.py index 5ce52f75..55c2cf86 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -199,18 +199,3 @@ class CommitComment(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/CommitStats.py b/github/CommitStats.py index 1be6a1d4..49f40778 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 4b9602a7..d08e0274 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Comparison.py b/github/Comparison.py index cfebc0c0..f5f66bc1 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/ContentFile.py b/github/ContentFile.py index fda1d3d6..03818842 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Download.py b/github/Download.py index 7555a8c3..86b7ae44 100644 --- a/github/Download.py +++ b/github/Download.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Event.py b/github/Event.py index b9752ec1..20351025 100644 --- a/github/Event.py +++ b/github/Event.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -128,10 +128,3 @@ class Event(github.GithubObject.NonCompletableGithubObject): 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/File.py b/github/File.py index 538fde6b..6adaae8a 100644 --- a/github/File.py +++ b/github/File.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Gist.py b/github/Gist.py index c7294a08..aca39fc1 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -5,8 +5,8 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -360,18 +360,3 @@ class Gist(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/GistComment.py b/github/GistComment.py index c832338a..6c7e2461 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -139,18 +139,3 @@ class GistComment(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/GistFile.py b/github/GistFile.py index a153c7ba..96c8ee27 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 13762e2a..bc24d5c0 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -98,15 +98,3 @@ class GistHistoryState(github.GithubObject.CompletableGithubObject): if "version" in attributes: # pragma no branch assert attributes["version"] is None or isinstance(attributes["version"], (str, unicode)), attributes["version"] self._version = attributes["version"] - - - - - - - - - - - - diff --git a/github/GitAuthor.py b/github/GitAuthor.py index dd409dea..e56ce94d 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/GitBlob.py b/github/GitBlob.py index ffb12f98..8f105682 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/GitCommit.py b/github/GitCommit.py index a281e491..ffdc6d5a 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -129,15 +129,3 @@ class GitCommit(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - - - - - - - - - - - - diff --git a/github/GitObject.py b/github/GitObject.py index 2d29b437..a7314641 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/GitRef.py b/github/GitRef.py index 8fe1945e..a666156b 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitTag.py b/github/GitTag.py index 0ffb00e0..564b6b86 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -110,15 +110,3 @@ class GitTag(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - - - - - - - - - - - - diff --git a/github/GitTree.py b/github/GitTree.py index 570bfee4..b06c5e82 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -80,8 +80,3 @@ class GitTree(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - - - - - diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index bf361be0..e7ae76bb 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/GithubObject.py b/github/GithubObject.py index 3fc89992..fcf36c29 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/GitignoreTemplate.py b/github/GitignoreTemplate.py index a1b96d7c..a8a7022f 100644 --- a/github/GitignoreTemplate.py +++ b/github/GitignoreTemplate.py @@ -3,6 +3,7 @@ ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Hook.py b/github/Hook.py index d59b5afd..2ca42db1 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -206,4 +206,3 @@ class Hook(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - diff --git a/github/HookDescription.py b/github/HookDescription.py index 766cbfc7..5653492b 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/HookResponse.py b/github/HookResponse.py index 87dc0ac0..41e242b3 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Issue.py b/github/Issue.py index eb58e20e..48d8922f 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -6,8 +6,8 @@ # Copyright 2012 Philip Kimmey # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -432,18 +432,3 @@ class Issue(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/IssueComment.py b/github/IssueComment.py index 254398c1..5a3c62da 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Michael Stead # # Copyright 2013 Vincent Jacques # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -152,18 +152,3 @@ class IssueComment(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 0a897a69..aca4cdf8 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -122,15 +122,3 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - - - - - - - - - - - - diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index cdc1b44b..ae7e6b6c 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Label.py b/github/Label.py index e2d42335..b3c75501 100644 --- a/github/Label.py +++ b/github/Label.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # # # diff --git a/github/Legacy.py b/github/Legacy.py index 4270f7a5..1ed760e2 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -5,8 +5,8 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -69,7 +69,6 @@ class PaginatedList(github.PaginatedList.PaginatedListBase): ] - def convertUser(attributes): convertedAttributes = { "login": attributes["login"], diff --git a/github/MainClass.py b/github/MainClass.py index 19531a48..a3a5a003 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -2,10 +2,10 @@ ############################ Copyrights and license ############################ # # +# Copyright 2013 AKFish # # Copyright 2013 Jonathan J Hunt # # Copyright 2013 Peter Golm # # Copyright 2013 Vincent Jacques # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -246,7 +246,7 @@ class Github(object): None, None ) - return github.NamedUser.NamedUser(self.__requester, headers, Legacy.convertUser(data["user"]), completed=False) + return github.NamedUser.NamedUser(self.__requester, headers, Legacy.convertUser(data["user"]), completed=False) def render_markdown(self, text, context=github.GithubObject.NotSet): """ @@ -311,7 +311,7 @@ class Github(object): ) return GitignoreTemplate.GitignoreTemplate(self.__requester, headers, attributes, completed=True) - def create_from_raw_data(self, klass, raw_data, headers = {}): + def create_from_raw_data(self, klass, raw_data, headers={}): """ Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data` @@ -320,13 +320,3 @@ class Github(object): :rtype: instance of class ``klass`` """ return klass(self.__requester, headers, raw_data, completed=True) - - - - - - - - - - diff --git a/github/Milestone.py b/github/Milestone.py index 47b7c0bb..db38437f 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/NamedUser.py b/github/NamedUser.py index df30b919..8a7a63bf 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -5,8 +5,8 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Notification.py b/github/Notification.py index 29c06b53..306a64c9 100644 --- a/github/Notification.py +++ b/github/Notification.py @@ -2,10 +2,10 @@ ############################ Copyrights and license ############################ # # +# Copyright 2013 AKFish # # Copyright 2013 Peter Golm # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -121,6 +121,3 @@ class Notification(github.GithubObject.CompletableGithubObject): if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] - - - diff --git a/github/NotificationSubject.py b/github/NotificationSubject.py index d32977ea..20ffa42e 100644 --- a/github/NotificationSubject.py +++ b/github/NotificationSubject.py @@ -2,6 +2,7 @@ ############################ Copyrights and license ############################ # # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Organization.py b/github/Organization.py index fb2fe969..d252a054 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -5,9 +5,9 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/PaginatedList.py b/github/PaginatedList.py index f4f81d85..5fd61159 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -4,10 +4,10 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Bill Mill # # Copyright 2013 Vincent Jacques # # Copyright 2013 davidbrai # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -27,7 +27,7 @@ ################################################################################ import github.GithubObject -import inspect + class PaginatedListBase: def __init__(self): @@ -127,8 +127,8 @@ class PaginatedList(PaginatedListBase): return [ self.__contentClass(self.__requester, headers, element, completed=False) - for element in data] - + for element in data + ] def __parseLinkHeader(self, headers): links = {} @@ -151,5 +151,5 @@ class PaginatedList(PaginatedListBase): return [ self.__contentClass(self.__requester, headers, element, completed=False) - for element in data] - + for element in data + ] diff --git a/github/Permissions.py b/github/Permissions.py index 8b9f3b39..3a3b4206 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/Plan.py b/github/Plan.py index 1daefc7c..99a3c3a6 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # diff --git a/github/PullRequest.py b/github/PullRequest.py index 05438de8..8ea72e55 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -5,9 +5,9 @@ # Copyright 2012 Michael Stead # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -500,7 +500,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): self._additions = attributes["additions"] if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] - self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["assignee"], completed=False) + self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] self._base = None if attributes["base"] is None else github.PullRequestPart.PullRequestPart(self._requester, self._headers, attributes["base"], completed=False) @@ -576,18 +576,3 @@ class PullRequest(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index b51eb8a1..efc520cf 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -4,10 +4,10 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Michael Stead # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -213,18 +213,3 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - - - - - - diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index f9bae790..9c416dbd 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # # # diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 8c5dcb43..791452b0 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -4,8 +4,8 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # -# Copyright 2013 Vincent Jacques # # Copyright 2013 AKFish # +# Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -93,13 +93,3 @@ class PullRequestPart(github.GithubObject.NonCompletableGithubObject): if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, self._headers, attributes["user"], completed=False) - - - - - - - - - - diff --git a/github/Repository.py b/github/Repository.py index 4bbad55c..411228d4 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -6,10 +6,10 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Mark Roddy # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 91efacf2..074985d8 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -4,10 +4,10 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Srijan Choudhary # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Requester.py b/github/Requester.py index 7d944c3e..d8196511 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -9,9 +9,9 @@ # Copyright 2012 Steve English # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Jonathan J Hunt # # Copyright 2013 Vincent Jacques # -# Copyright 2013 akfish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -61,7 +61,7 @@ class Requester: def resetConnectionClasses(cls): cls.__httpConnectionClass = httplib.HTTPConnection cls.__httpsConnectionClass = httplib.HTTPSConnection - + ############################################################# # For Debug @classmethod @@ -105,10 +105,9 @@ class Requester: ''' if not self.DEBUG_FLAG: return - + self._frameBuffer[self._frameCount][1:4] = [statusCode, responseHeader, data] responseHeader[self.DEBUG_HEADER_KEY] = self._frameCount - def check_me(self, obj): if self.DEBUG_FLAG and self.ON_CHECK_ME is not None: @@ -121,6 +120,7 @@ class Requester: def _initializeDebugFeature(self): self._frameCount = 0 self._frameBuffer = [] + ############################################################# def __init__(self, login_or_token, password, base_url, timeout, client_id, client_secret, user_agent, per_page): diff --git a/github/Tag.py b/github/Tag.py index 4ac411ab..890c1a02 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -4,9 +4,9 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # -# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # diff --git a/github/Team.py b/github/Team.py index b6d681d6..804ed3ab 100644 --- a/github/Team.py +++ b/github/Team.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # # # diff --git a/github/UserKey.py b/github/UserKey.py index 222cd1a5..44cc5808 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # Copyright 2013 martinqt # # # diff --git a/github/tests/Framework.py b/github/tests/Framework.py index 24a359bd..24e814b4 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -4,6 +4,7 @@ # # # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # +# Copyright 2013 AKFish # # Copyright 2013 Vincent Jacques # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # @@ -249,29 +250,21 @@ class TestCase(BasicTestCase): return if obj._headers is None and frame == {}: return - self.assertEqual(obj._headers, frame[2]); - + self.assertEqual(obj._headers, frame[2]) def getFrameChecker(self): return lambda requester, obj, frame: self.doCheckFrame(obj, frame) def setUp(self): BasicTestCase.setUp(self) - - # Set up frame debugging - - github.GithubObject.GithubObject.setCheckAfterInitFlag(True) + # Set up frame debugging + github.GithubObject.GithubObject.setCheckAfterInitFlag(True) github.Requester.Requester.setDebugFlag(True) - github.Requester.Requester.setOnCheckMe(self.getFrameChecker()) self.g = github.Github(self.login, self.password) - - - def activateRecordMode(): # pragma no cover (Function useful only when recording new tests, not used during automated tests) BasicTestCase.recordMode = True -