From b4b8aa9e11759d2595a06e32abe6e9a24ecd0a43 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 12 Feb 2012 21:17:08 +0100 Subject: [PATCH] Organization.get_repos --- IntegrationTest.py | 1 + Reference.md | 2 +- github/GithubObjects.py | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IntegrationTest.py b/IntegrationTest.py index e78a4654..b31240d2 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -23,6 +23,7 @@ def dumpUser( u ): def dumpOrganization( o ): print o.login, "(", o.name, ")" print " Members:", ", ".join( u.login for u in o.get_members() ) + print " Repos:", ", ".join( r.name for r in o.get_repos() ) print dumpUser( g.get_user() ) diff --git a/Reference.md b/Reference.md index d09e405e..d6913cdf 100644 --- a/Reference.md +++ b/Reference.md @@ -91,7 +91,7 @@ /orgs/:org/repos ================ - - GET: `` (TODO) + - GET: `Organization.get_repos()`: list of `Repository` - POST: `` (TODO) /orgs/:org/teams diff --git a/github/GithubObjects.py b/github/GithubObjects.py index 21aca302..991ef29e 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -25,6 +25,7 @@ NamedUser = GithubObject( AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "followers", NamedUser ) ) NamedUser._addAttributePolicy( ExtendedListAttribute( "followers", NamedUser ) ) + AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "following", NamedUser ) ) NamedUser._addAttributePolicy( ExtendedListAttribute( "following", NamedUser ) ) @@ -64,7 +65,8 @@ Repository._addAttributePolicy( ExtendedScalarAttribute( "parent", Repository ) Repository._addAttributePolicy( ExtendedScalarAttribute( "source", Repository ) ) AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "repos", Repository ) ) -AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "watched", Repository ) ) - NamedUser._addAttributePolicy( ExtendedListAttribute( "repos", Repository ) ) +Organization._addAttributePolicy( ExtendedListAttribute( "repos", Repository ) ) + +AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "watched", Repository ) ) NamedUser._addAttributePolicy( ExtendedListAttribute( "watched", Repository ) )