From c83b0ef7d5aae46bd47312530e8825b4e828aa80 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 20 Oct 2013 19:09:30 -0700 Subject: [PATCH] Remove Repository.create_download and NamedUser.create_gist --- README.rst | 1 + github/NamedUser.py | 25 ------------------------- github/Repository.py | 28 ---------------------------- 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/README.rst b/README.rst index 8f82f590..d537cf8c 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,7 @@ Starting today (September 5th, 2013), we now need more than 8 bits to store the * `Implement `_ ``Github.get_hook(name)``. Thank you `klmitch `_ for asking * In case bad data is returned by Github API v3, `raise `_ an exception only when the user accesses the faulty attribute, not when constructing the object containing this attribute. Thank you `klmitch `_ for asking * `Fix `_ parameter public/private of ``Repository.edit``. Thank you `daireobroin449 `_ for reporting the issue +* Remove ``Repository.create_download`` and ``NamedUser.create_gist`` as the corrensponding APIs are not documented anymore What's missing? =============== diff --git a/github/NamedUser.py b/github/NamedUser.py index a64ab047..f858b4bf 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -329,31 +329,6 @@ class NamedUser(github.GithubObject.CompletableGithubObject): self._completeIfNotSet(self._url) return self._url.value - # v2: Remove this method - def create_gist(self, public, files, description=github.GithubObject.NotSet): - """ - :calls: `POST /users/:user/gists `_ - :param public: bool - :param files: dict of string to :class:`github.InputFileContent.InputFileContent` - :param description: string - :rtype: :class:`github.Gist.Gist` - """ - assert isinstance(public, bool), public - assert all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files - assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description - post_parameters = { - "public": public, - "files": dict((key, value._identity) for key, value in files.iteritems()), - } - if description is not github.GithubObject.NotSet: - post_parameters["description"] = description - headers, data = self._requester.requestJsonAndCheck( - "POST", - self.url + "/gists", - input=post_parameters - ) - return github.Gist.Gist(self._requester, headers, data, completed=True) - def get_events(self): """ :calls: `GET /users/:user/events `_ diff --git a/github/Repository.py b/github/Repository.py index 8e27710f..ddfc71c0 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -655,34 +655,6 @@ class Repository(github.GithubObject.CompletableGithubObject): ) 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): - """ - :calls: `POST /repos/:owner/:repo/downloads `_ - :param name: string - :param size: integer - :param description: string - :param content_type: string - :rtype: :class:`github.Download.Download` - """ - assert isinstance(name, (str, unicode)), name - assert isinstance(size, (int, long)), size - assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert content_type is github.GithubObject.NotSet or isinstance(content_type, (str, unicode)), content_type - post_parameters = { - "name": name, - "size": size, - } - if description is not github.GithubObject.NotSet: - post_parameters["description"] = description - if content_type is not github.GithubObject.NotSet: - post_parameters["content_type"] = content_type - headers, data = self._requester.requestJsonAndCheck( - "POST", - self.url + "/downloads", - input=post_parameters - ) - return github.Download.Download(self._requester, headers, data, completed=True) - def create_git_blob(self, content, encoding): """ :calls: `POST /repos/:owner/:repo/git/blobs `_