mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Github.get_repos (to get all public repositories)
This commit is contained in:
+1
-4
@@ -12,6 +12,7 @@ What's new?
|
||||
|
||||
`Version 1.19.0 <https://github.com/jacquev6/PyGithub/issues?milestone=31&state=closed>`_ (?? ??th, 2013)
|
||||
|
||||
* Implement ``Github.get_repos`` to get all public repositories
|
||||
* Implement ``NamedUser.has_in_following``
|
||||
* Use the new URL to fork gists (minor change)
|
||||
* Use the new URL to test hooks (minor change)
|
||||
@@ -56,10 +57,6 @@ Github API v3 URLs not (yet) covered by PyGithub
|
||||
* ``/repos/:owner/:repo/subscription`` (DELETE)
|
||||
* ``/repos/:owner/:repo/subscription`` (GET)
|
||||
* ``/repos/:owner/:repo/subscription`` (PUT)
|
||||
* ``/repositories`` (GET)
|
||||
|
||||
* should be called in method ``Github.get_repos``
|
||||
|
||||
* ``/search/code`` (GET)
|
||||
* ``/search/issues`` (GET)
|
||||
* ``/search/repositories`` (GET)
|
||||
|
||||
@@ -195,6 +195,23 @@ class Github(object):
|
||||
)
|
||||
return Repository.Repository(self.__requester, data, completed=True)
|
||||
|
||||
def get_repos(self, since=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_
|
||||
:param since: integer
|
||||
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
|
||||
"""
|
||||
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.Repository.Repository,
|
||||
self.__requester,
|
||||
"/repositories",
|
||||
url_parameters
|
||||
)
|
||||
|
||||
def get_gist(self, id):
|
||||
"""
|
||||
:calls: `GET /gists/:id <http://developer.github.com/v3/gists>`_
|
||||
|
||||
@@ -128,3 +128,9 @@ class Github(Framework.TestCase):
|
||||
|
||||
def testGetUsersSince(self):
|
||||
self.assertListKeyBegin(self.g.get_users(since=1000), lambda u: u.login, ["sbecker"])
|
||||
|
||||
def testGetRepos(self):
|
||||
self.assertListKeyBegin(self.g.get_repos(), lambda r: r.name, ["grit", "merb-core", "rubinius", "god", "jsawesome", "jspec", "exception_logger", "ambition"])
|
||||
|
||||
def testGetReposSince(self):
|
||||
self.assertListKeyBegin(self.g.get_repos(since=1000), lambda r: r.name, ["jquery-humanize-messages-plugin", "4slicer", "fixture-scenarios", "mongrel_proctitle", "rails-plugins"])
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user