Implement GET /users (issue #173)

This commit is contained in:
Vincent Jacques
2013-06-18 17:58:29 +02:00
parent 8e69f693dc
commit f62f384bc6
5 changed files with 61 additions and 1 deletions
+18 -1
View File
@@ -99,7 +99,7 @@ class Github(object):
def get_user(self, login=github.GithubObject.NotSet):
"""
:calls: `GET /users/:user <http://developer.github.com/v3/todo>`_
:calls: `GET /users/:user <http://developer.github.com/v3/users/#get-a-single-user>`_ or `GET /user <http://developer.github.com/v3/users/#get-the-authenticated-user>`_
:param login: string
:rtype: :class:`github.NamedUser.NamedUser`
"""
@@ -115,6 +115,23 @@ class Github(object):
)
return github.NamedUser.NamedUser(self.__requester, data, completed=True)
def get_users(self, since=github.GithubObject.NotSet):
"""
:calls: `GET /users <http://developer.github.com/v3/users/#get-all-users>`_
:param since: integer
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
assert since is github.GithubObject.NotSet or isinstance(since, (int, long)), since
url_parameters = dict()
if since is not github.GithubObject.NotSet:
url_parameters["since"] = since
return github.PaginatedList.PaginatedList(
github.NamedUser.NamedUser,
self.__requester,
"/users",
url_parameters
)
def get_organization(self, login):
"""
:calls: `GET /orgs/:org <http://developer.github.com/v3/todo>`_