diff --git a/github/Event.py b/github/Event.py new file mode 100644 index 00000000..ba568058 --- /dev/null +++ b/github/Event.py @@ -0,0 +1,9 @@ +from GithubObject import * + +Event = GithubObject( + "Event", + InternalSimpleAttributes( + "type", "public", "payload", "created_at", "id", "commit_id", "url", + "event", "issue", + ), +) diff --git a/github/GithubObjects.py b/github/GithubObjects.py index a5dff5b8..dca59b9d 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -1,30 +1,9 @@ -import itertools import urllib from GithubObject import * -Event = GithubObject( - "Event", - InternalSimpleAttributes( - "type", "public", "payload", "created_at", "id", "commit_id", "url", - "event", "issue", - ), -) - -def __testHook( hook ): - hook._github._statusRequest( "POST", hook._baseUrl() + "/test", None, None ) -Hook = GithubObject( - "Hook", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/hooks/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "updated_at", "created_at", "name", "events", "active", "config", - "id", "last_response", - "_repo", - ), - Editable( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ), - Deletable(), - SeveralAttributePolicies( [ MethodFromCallable( "test", [], [], __testHook, SimpleTypePolicy( None ) ) ], "Testing" ) -) +from Event import Event +from Hook import Hook Authorization = GithubObject( "Authorization", diff --git a/github/Hook.py b/github/Hook.py new file mode 100644 index 00000000..07f9660e --- /dev/null +++ b/github/Hook.py @@ -0,0 +1,16 @@ +from GithubObject import * + +def __testHook( hook ): + hook._github._statusRequest( "POST", hook._baseUrl() + "/test", None, None ) +Hook = GithubObject( + "Hook", + BaseUrl( lambda obj: obj._repo._baseUrl() + "/hooks/" + str( obj.id ) ), + InternalSimpleAttributes( + "url", "updated_at", "created_at", "name", "events", "active", "config", + "id", "last_response", + "_repo", + ), + Editable( [ "name", "config" ], [ "events", "add_events", "remove_events", "active" ] ), + Deletable(), + SeveralAttributePolicies( [ MethodFromCallable( "test", [], [], __testHook, SimpleTypePolicy( None ) ) ], "Testing" ) +)