From dc8173a5328cede580cae7e2bbf053ee98185d4e Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 15:39:34 +0800 Subject: [PATCH] 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): """