Separate the three distributed classes

This commit is contained in:
Vincent Jacques
2012-03-14 23:24:49 +01:00
parent 32ed0ebc37
commit 6e421e9e85
4 changed files with 134 additions and 120 deletions
@@ -0,0 +1,27 @@
from Repository import *
from Team import *
from Event import *
Repository._addAttributePolicy(
ExternalListOfObjects( "teams", "team", Team,
ListGetable( [], [] )
)
)
Repository._addAttributePolicy(
ExternalListOfObjects( "events", "event", Event,
ListGetable( [], [] )
),
)
def __getNetworkEvents( repo ):
return [
Event( repo._github, attributes, lazy = True )
for attributes
in repo._github._dataRequest( "GET", "/networks/" + repo.owner.login + "/" + repo.name + "/events", None, None )
]
Repository._addAttributePolicy(
MethodFromCallable( "get_network_events", [], [], __getNetworkEvents, SimpleTypePolicy( "list of `Event`" ) )
)