mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Separate the three distributed classes
This commit is contained in:
@@ -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`" ) )
|
||||
)
|
||||
Reference in New Issue
Block a user