mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Remove Repository.create_download and NamedUser.create_gist
This commit is contained in:
@@ -22,6 +22,7 @@ Starting today (September 5th, 2013), we now need more than 8 bits to store the
|
||||
* `Implement <https://github.com/jacquev6/PyGithub/issues/196>`_ ``Github.get_hook(name)``. Thank you `klmitch <https://github.com/klmitch>`_ for asking
|
||||
* In case bad data is returned by Github API v3, `raise <https://github.com/jacquev6/PyGithub/issues/195>`_ an exception only when the user accesses the faulty attribute, not when constructing the object containing this attribute. Thank you `klmitch <https://github.com/klmitch>`_ for asking
|
||||
* `Fix <https://github.com/jacquev6/PyGithub/issues/199>`_ parameter public/private of ``Repository.edit``. Thank you `daireobroin449 <https://github.com/daireobroin449>`_ for reporting the issue
|
||||
* Remove ``Repository.create_download`` and ``NamedUser.create_gist`` as the corrensponding APIs are not documented anymore
|
||||
|
||||
What's missing?
|
||||
===============
|
||||
|
||||
@@ -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 <http://developer.github.com/v3/todo>`_
|
||||
: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 <http://developer.github.com/v3/activity/events>`_
|
||||
|
||||
@@ -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 <http://developer.github.com/v3/repos/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 <http://developer.github.com/v3/git/blobs>`_
|
||||
|
||||
Reference in New Issue
Block a user