diff --git a/IntegrationTest.py b/IntegrationTest.py index 7d429d14..e78a4654 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -16,6 +16,8 @@ def dumpUser( u ): print print " Watched:", ", ".join( r.name for r in u.get_watched() ) print " Organizations:", ", ".join( o.login for o in u.get_orgs() ) + print " Following:", ", ".join( f.login for f in u.get_following() ) + print " Followers:", ", ".join( f.login for f in u.get_followers() ) print def dumpOrganization( o ): diff --git a/Reference.md b/Reference.md index 4e57e874..d09e405e 100644 --- a/Reference.md +++ b/Reference.md @@ -399,11 +399,11 @@ /user/followers =============== - - GET: `` (TODO) + - GET: `AuthenticatedUser.get_followers()` : list of `NamedUser` /user/following =============== - - GET: `` (TODO) + - GET: `AuthenticatedUser.get_following()` : list of `NamedUser` /user/following/:user ===================== @@ -459,11 +459,11 @@ /users/:user/followers ====================== - - GET: `` (TODO) + - GET: `NamedUser.get_followers()` : list of `NamedUser` /users/:user/following ====================== - - GET: `` (TODO) + - GET: `NamedUser.get_following()` : list of `NamedUser` /users/:user/gists ================== diff --git a/github/GithubObjects.py b/github/GithubObjects.py index eca97b08..21aca302 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -23,6 +23,11 @@ NamedUser = GithubObject( ), ) +AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "followers", NamedUser ) ) +NamedUser._addAttributePolicy( ExtendedListAttribute( "followers", NamedUser ) ) +AuthenticatedUser._addAttributePolicy( ExtendedListAttribute( "following", NamedUser ) ) +NamedUser._addAttributePolicy( ExtendedListAttribute( "following", NamedUser ) ) + Organization = GithubObject( "Organization", BaseUrl( lambda obj: "/orgs/" + obj.login ),