From 07b6b437d741df9c94cf34e36045fc78868b63ba Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 12 Mar 2012 20:43:20 +0100 Subject: [PATCH] Remove two 'MethodFromCallable' --- github/GithubObjects.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/github/GithubObjects.py b/github/GithubObjects.py index 5b127bb8..42197018 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -136,14 +136,10 @@ def __getPublicEvents( user ): NamedUser._addAttributePolicy( MethodFromCallable( "get_public_events", [], [], __getPublicEvents, SimpleTypePolicy( "list of `Event`" ) ) ) -def __getReceivedEvents( user ): - return [ - Event( user._github, attributes, lazy = True ) - for attributes - in user._github._dataRequest( "GET", user._baseUrl + "/received_events", None, None ) - ] NamedUser._addAttributePolicy( - MethodFromCallable( "get_received_events", [], [], __getReceivedEvents, SimpleTypePolicy( "list of `Event`" ) ) + ExternalListOfObjects( "received_events", "received_event", Event, + ListGetable( [], [] ) + ) ) def __getPublicReceivedEvents( user ): return [ @@ -472,17 +468,13 @@ def __getNetworkEvents( repo ): for attributes in repo._github._dataRequest( "GET", "/networks/" + repo.owner.login + "/" + repo.name + "/events", None, None ) ] -def __getIssuesEvents( repo ): - return [ - Event( repo._github, attributes, lazy = True ) - for attributes - in repo._github._dataRequest( "GET", repo._baseUrl + "/issues/events", None, None ) - ] Repository._addAttributePolicy( MethodFromCallable( "get_network_events", [], [], __getNetworkEvents, SimpleTypePolicy( "list of `Event`" ) ) ) Repository._addAttributePolicy( - MethodFromCallable( "get_issues_events", [], [], __getIssuesEvents, SimpleTypePolicy( "list of `Event`" ) ) + ExternalListOfObjects( "issues/events", "issues_event", Event, + ListGetable( [], [] ) + ) ) Repository._addAttributePolicy( ExternalListOfObjects( "forks", "fork", Repository,